Re: [sqlalchemy] Session.flush() before Session.begin()

2016-02-04 Thread Jonathan Vanasco
On Thursday, February 4, 2016 at 9:36:43 AM UTC-5, Michael Bayer wrote: You might find it a better approach overall to use a separate Session > for persistence, have your users deal with entirely detached objects and > then just copy their state to the Session when you're ready to persist >

Re: [sqlalchemy] Session.flush() before Session.begin()

2016-02-04 Thread Mike Bayer
On 02/03/2016 11:10 PM, James Emerton wrote: im not sure why you need to use begin() at all? in autocommit mode, the user presses save, you just call flush(). flush() always uses a transaction internally. That's originally how the Session was meant to be used, having an explicitly

Re: [sqlalchemy] Session.flush() before Session.begin()

2016-02-03 Thread Mike Bayer
On 02/03/2016 09:39 PM, jemer...@spiresystems.com wrote: We're using SQLAlchemy in a GUI application and have been experiencing some challenges integrating the ORM Session with our usage model. (This is difficult to change as we have ported from a legacy system to SQLAlchemy.) We're currently

Re: [sqlalchemy] Session.flush() before Session.begin()

2016-02-03 Thread James Emerton
> On Feb 3, 2016, at 7:07 PM, Mike Bayer wrote: > > On 02/03/2016 09:39 PM, jemer...@spiresystems.com wrote: >> We're using SQLAlchemy in a GUI application and have been experiencing >> some challenges integrating the ORM Session with our usage model. (This >> is