Re: [sqlalchemy] Looks like there is no event to catch "before" a rollback happens

2017-03-11 Thread mike bayer
On 03/11/2017 10:15 AM, mike bayer wrote: On 03/10/2017 11:12 AM, Alessandro Molina wrote: On Fri, Mar 10, 2017 at 3:40 PM, mike bayer > wrote: If this is truly, "unexpected error but we need to do things", perhaps you

Re: [sqlalchemy] Looks like there is no event to catch "before" a rollback happens

2017-03-11 Thread mike bayer
On 03/10/2017 11:12 AM, Alessandro Molina wrote: On Fri, Mar 10, 2017 at 3:40 PM, mike bayer > wrote: If this is truly, "unexpected error but we need to do things", perhaps you can use before_flush() to memoize the details

Re: [sqlalchemy] Looks like there is no event to catch "before" a rollback happens

2017-03-10 Thread Simon King
On Fri, Mar 10, 2017 at 4:12 PM, Alessandro Molina wrote: > > > On Fri, Mar 10, 2017 at 3:40 PM, mike bayer > wrote: >> >> If this is truly, "unexpected error but we need to do things", perhaps you >> can use before_flush() to memoize the

Re: [sqlalchemy] Looks like there is no event to catch "before" a rollback happens

2017-03-10 Thread Alessandro Molina
On Fri, Mar 10, 2017 at 3:40 PM, mike bayer wrote: > If this is truly, "unexpected error but we need to do things", perhaps you > can use before_flush() to memoize the details you need for a restore inside > of session.info. > > An event hook can be added but it would

Re: [sqlalchemy] Looks like there is no event to catch "before" a rollback happens

2017-03-10 Thread mike bayer
On 03/10/2017 01:57 AM, Alessandro Molina wrote: I have been looking for a way to know what's going to be rolled back in SQLAlchemy so that I can know what was changed and restore other database unrelated things to their previous state. By

[sqlalchemy] Looks like there is no event to catch "before" a rollback happens

2017-03-09 Thread Alessandro Molina
I have been looking for a way to know what's going to be rolled back in SQLAlchemy so that I can know what was changed and restore other database unrelated things to their previous state. By http://docs.sqlalchemy.org/en/latest/orm/events.html#session-events it looks like it's available an