I am upgrading a legacy application from DataMapper 0.10.2 to 1.1.0.
The app uses transactions in its tests, and I can't really figure out
how transactions are supposed to work in DataMapper.
What I'm doing basically boils down to this:
repo = DataMapper.repository(:default)
transaction = DataMapper::Transaction.new(repo)
transaction.begin
Customer.create(:name => 'Jonas')
transaction.rollback
This pastie contains a full example which illustrates the problem:
http://pastie.org/2111523
I am getting this output:
### DM TRANSACTION ###
before: 0
during: 1
after: 1
### MANUAL TRANSACTION ###
before: 0
during: 1
after: 0
As you can see, the manual transaction is rolled back properly, while
the DM transaction is in fact not rolled back at all.
Am I doing something wrong, or is this just broken?
/Jonas
--
You received this message because you are subscribed to the Google Groups
"DataMapper" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/datamapper?hl=en.