Re: [sqlalchemy] Executing callback after current transaction commit unless rollback occurs

2016-03-29 Thread Mike Bayer
the flush() process uses its own subtransaction. On 03/29/2016 09:48 AM, Yegor Roganov wrote: Thank you very much! If you don't mind me asking again, I'm a bit confused why there are non-toplevel transactions as I didn't use any subtransactions/savepoints. On Tuesday, March 29, 2016 at

Re: [sqlalchemy] Executing callback after current transaction commit unless rollback occurs

2016-03-29 Thread Yegor Roganov
Thank you very much! If you don't mind me asking again, I'm a bit confused why there are non-toplevel transactions as I didn't use any subtransactions/savepoints. On Tuesday, March 29, 2016 at 4:01:45 PM UTC+3, Mike Bayer wrote: > > > > On 03/29/2016 12:32 AM, Yegor Roganov wrote: > > Thanks

Re: [sqlalchemy] Executing callback after current transaction commit unless rollback occurs

2016-03-29 Thread Mike Bayer
On 03/29/2016 12:32 AM, Yegor Roganov wrote: Thanks Mike Unfortunately it seems that after_transaction_end event executes twice: right before COMMIT and after after_commit event. Here what I see with echo=True and some prints: OK you need to filter out for the top-level transaction only:

Re: [sqlalchemy] Executing callback after current transaction commit unless rollback occurs

2016-03-28 Thread Yegor Roganov
Thanks Mike Unfortunately it seems that after_transaction_end event executes twice: right before COMMIT and after after_commit event. Here what I see with echo=True and some prints: 2016-03-29 07:29:14,799 INFO sqlalchemy.engine.base.Engine INSERT INTO users (id) VALUES (?) 2016-03-29

Re: [sqlalchemy] Executing callback after current transaction commit unless rollback occurs

2016-03-28 Thread Jonathan Vanasco
You could also implement a Two Phase Commit using `zope.sqlalchemy` and the `transaction` package. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to

Re: [sqlalchemy] Executing callback after current transaction commit unless rollback occurs

2016-03-28 Thread Mike Bayer
On 03/28/2016 03:21 PM, Yegor Roganov wrote: I would like to get what I described in the subject: attach an event listener that will execute once after current transaction's successful commit (analogue to django's on_commit

[sqlalchemy] Executing callback after current transaction commit unless rollback occurs

2016-03-28 Thread Yegor Roganov
I would like to get what I described in the subject: attach an event listener that will execute once after current transaction's successful commit (analogue to django's on_commit ). If current