Re: [sqlalchemy] How to handle 'sub-commits'?

2013-01-17 Thread Ken Lareau
Sadly, it looks like when I try the code in my full application, it is failing miserably. I'm seeing errors like this: sqlalchemy.orm.exc.DetachedInstanceError: Instance Deployments at 0x3367910 is not bound to a Session; attribute refresh operation cannot proceed and

Re: [sqlalchemy] How to handle 'sub-commits'?

2013-01-17 Thread Ken Lareau
On Thu, Jan 17, 2013 at 4:13 PM, Michael Bayer mike...@zzzcomputing.comwrote: On Jan 17, 2013, at 7:01 PM, Ken Lareau wrote: On Thu, Jan 17, 2013 at 3:54 PM, Michael Bayer mike...@zzzcomputing.comwrote: On Jan 17, 2013, at 6:45 PM, Ken Lareau wrote: Sadly, it looks like when I try the

Re: [sqlalchemy] How to handle 'sub-commits'?

2013-01-17 Thread Michael Bayer
On Jan 17, 2013, at 7:24 PM, Ken Lareau wrote: On Thu, Jan 17, 2013 at 4:13 PM, Michael Bayer mike...@zzzcomputing.com wrote: On Jan 17, 2013, at 7:01 PM, Ken Lareau wrote: On Thu, Jan 17, 2013 at 3:54 PM, Michael Bayer mike...@zzzcomputing.com wrote: On Jan 17, 2013, at 6:45

Re: [sqlalchemy] How to handle 'sub-commits'?

2013-01-17 Thread Ken Lareau
On Thu, Jan 17, 2013 at 4:26 PM, Michael Bayer mike...@zzzcomputing.comwrote: On Jan 17, 2013, at 7:24 PM, Ken Lareau wrote: On Thu, Jan 17, 2013 at 4:13 PM, Michael Bayer mike...@zzzcomputing.comwrote: On Jan 17, 2013, at 7:01 PM, Ken Lareau wrote: On Thu, Jan 17, 2013 at 3:54 PM,

Re: [sqlalchemy] How to handle 'sub-commits'?

2013-01-08 Thread Michael Bayer
On Jan 8, 2013, at 4:00 PM, Ken Lareau wrote: Given this and your previous comments, and after some conversations with a coworker, I decided to expose the 'engine' variable from the database library and create a context manager as so: @contextlib.contextmanager def

Re: [sqlalchemy] How to handle 'sub-commits'?

2013-01-08 Thread Ken Lareau
On Tue, Jan 8, 2013 at 2:16 PM, Michael Bayer mike...@zzzcomputing.comwrote: On Jan 8, 2013, at 4:00 PM, Ken Lareau wrote: Given this and your previous comments, and after some conversations with a coworker, I decided to expose the 'engine' variable from the database library and create a

Re: [sqlalchemy] How to handle 'sub-commits'?

2013-01-07 Thread Michael Bayer
On Jan 7, 2013, at 1:11 AM, Ken Lareau wrote: Okay, this is what I suspected and feared. :) Creating new sessions isn't much of an issue, and I came up with a class to manage this for me before realizing my problem is going to end up being much deeper... My current library that uses

Re: [sqlalchemy] How to handle 'sub-commits'?

2013-01-06 Thread Ken Lareau
Michael, Thanks for the response, see further questions/issues below... On Fri, Jan 4, 2013 at 8:41 AM, Michael Bayer mike...@zzzcomputing.comwrote: On Jan 3, 2013, at 10:18 PM, Ken Lareau wrote: I recently (today) ran into an issue that has me perplexed as to how to resolve it, so I'm

Re: [sqlalchemy] How to handle 'sub-commits'?

2013-01-04 Thread Michael Bayer
On Jan 3, 2013, at 10:18 PM, Ken Lareau wrote: I recently (today) ran into an issue that has me perplexed as to how to resolve it, so I'm asking here to see if anyone can shed some insight. Hopefully I can ex- plain it clearly enough to make me not sound completely incompetent... I