2010/1/28 kels0n <kelsen23 / gmail.com>:
> class TestRollback < ActiveRecord::Base
> end
>
> ActiveRecord::Base.establish_connection(
> =A0:adapter =3D> 'sqlserver',
> =A0:username =3D> 'user',
> =A0:password =3D> 'pass',
> =A0:database =3D> 'testdb',
> =A0:host =3D> 'localhost'
> )
>
> TestRollback.transaction do
> =A0TestRollback.create(:name =3D> 'Test')
> =A0raise ActiveRecord::Rollback
> end
>
> TestRollback.find(:all) =A0# returns [#<TestRollback name: "Test">]
>
> The only difference between this configuration and my one at home is I
> don't have version 1.15.6 of the activerecord gem installed on my home
> machine. =A0However, this script needs to use that version of
> activerecord because of some legacy code that I inherited and haven't
> had a chance to rewrite. =A0I'm hoping there's a way around this without
> having to rewrite the code.
>
> Any ideas?

I can't help you with AR but just making sure we exclude the easy
mistakes which still happen all the time: you have verified that the
record in question is not in the table before the TX starts, did you?

Kind regards

robert


--=20
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/