You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to web...@googlegroups.com
I want to insert records into two tables A and B. I will insert into A first then B.
and I like to rollback A when inserting into B failed. Is there any way to do this?
Thanks!
Dragan Matic
unread,
May 12, 2014, 4:28:19 AM5/12/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to web...@googlegroups.com
All database operations in your controllers which are executed through DAL are executed in a transaction. So every time you do a database operation in your controller it starts a new transaction which is automatically commited if there were no errors. If it encounters any error then the transaction is rolled back.
If you still want to control your transactions (e.g. if you wish to have more transaction in a single controller call) you can do it through db.commit() and db.rollback().