zhangjingl02 / activejdbc

Automatically exported from code.google.com/p/activejdbc
0 stars 0 forks source link

no documentation on transaction(atomic commit of changes) #198

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In most cases, we want to save our active record objects in one single 
transaction and I don't see anythig in the docuemntation for this.  most have 
the saveIt method on it, but we want to do something like hibernate's

tx.begin();//hopefully done in platform

bankAccount1.saveIt(); // -10 dollars
bankAccount2.saveIt(); // +10 dollars

txManager.flush(); 

tx.commit(); //hopefully done in platform and only really does something if 
flush is called.

or is there some other way of doing it?  Documentation oh this subject would be 
very nice.

NOTE: obviously if banckAccount2 save fails we might end up with the first bank 
account missing 10 while the second one did not receive the 10 so bank accounts 
don't add up and the cash just dissappeared.
thanks,
Dean

Original issue reported on code.google.com by dean.hil...@gmail.com on 25 Nov 2013 at 8:08

GoogleCodeExporter commented 9 years ago
Have  you seen this? 
https://code.google.com/p/activejdbc/wiki/Transactions

Original comment by i...@expresspigeon.com on 25 Nov 2013 at 9:41

GoogleCodeExporter commented 9 years ago

Original comment by i...@polevoy.org on 25 Nov 2013 at 9:41