[sqlalchemy] Re: Objects are wrongly getting removed/expunged from session

2011-01-15 Thread Tvrtko
On Jan 15, 11:56 am, Tvrtko qvx3...@gmail.com wrote: First, let me say that I'm using sqlalchemy version 0.5.8. We have a large and complex application and changing to sa 0.6 is expensive, so I would like, if possible, to find a solution for 0.5. I'm using sqlalchemy since version 0.1.

[sqlalchemy] Re: Objects are wrongly getting removed/expunged from session

2011-01-15 Thread Tvrtko
I've drilled down all the way up to `mapper._save_obj()`. I examined the `state.dict` for `qitem`. Good case: qitem state dict = {'campaign': Campaign 233, u'Test', 'campaign_id': 233, ...} And for the bad case: qitem state dict = {'campaign': Campaign 234, u'Test', 'campaign_id':

Re: [sqlalchemy] Re: Objects are wrongly getting removed/expunged from session

2011-01-15 Thread Michael Bayer
So, you have A-B, an exception occurs, you do the rollback, then you're somehow trying to continue on within the web request ? The code examples here are out of context snippets and I don't see any exception handling happening so they don't really tell me much.When the flush fails, the

[sqlalchemy] Re: Objects are wrongly getting removed/expunged from session

2011-01-15 Thread Tvrtko
On Jan 15, 4:35 pm, Michael Bayer mike...@zzzcomputing.com wrote: So, you have A-B, an exception occurs, you do the rollback, then you're somehow trying to continue on within the web request ?     The code examples here are out of context snippets and I don't see any exception handling

Re: [sqlalchemy] Re: Objects are wrongly getting removed/expunged from session

2011-01-15 Thread Michael Bayer
On Jan 15, 2011, at 11:10 AM, Tvrtko wrote: On Jan 15, 4:35 pm, Michael Bayer mike...@zzzcomputing.com wrote: So, you have A-B, an exception occurs, you do the rollback, then you're somehow trying to continue on within the web request ? The code examples here are out of context

[sqlalchemy] Re: Objects are wrongly getting removed/expunged from session

2011-01-15 Thread Tvrtko
This is my first such case in 5-6 years of using the SA. Usually the problem was with my code. This could also be the case now, but it escapes me where I made a mistake. Thank you for your time. I will consider this closed for now and move on using a workaround of explicitly populating

Re: [sqlalchemy] Re: Objects are wrongly getting removed/expunged from session

2011-01-15 Thread Michael Bayer
On Jan 15, 2011, at 11:53 AM, Tvrtko wrote: This is my first such case in 5-6 years of using the SA. Usually the problem was with my code. This could also be the case now, but it escapes me where I made a mistake. not suggesting you made a mistake. suggesting that some artifact of your

[sqlalchemy] Re: Objects are wrongly getting removed/expunged from session

2011-01-15 Thread Tvrtko
On Jan 15, 5:57 pm, Michael Bayer mike...@zzzcomputing.com wrote: On Jan 15, 2011, at 11:53 AM, Tvrtko wrote: This is my first such case in 5-6 years of using the SA. Usually the problem was with my code. This could also be the case now, but it escapes me where I made a mistake. not

[sqlalchemy] Re: Objects are wrongly getting removed/expunged from session

2011-01-15 Thread Tvrtko
On Jan 15, 5:53 pm, Tvrtko qvx3...@gmail.com wrote: This is my first such case in 5-6 years of using the SA. Usually the problem was with my code. This could also be the case now, but it escapes me where I made a mistake. Thank you for your time. I will consider this closed for now and move

Re: [sqlalchemy] Re: Objects are wrongly getting removed/expunged from session

2011-01-15 Thread Michael Bayer
On Jan 15, 2011, at 8:37 PM, Tvrtko wrote: On Jan 15, 5:53 pm, Tvrtko qvx3...@gmail.com wrote: This is my first such case in 5-6 years of using the SA. Usually the problem was with my code. This could also be the case now, but it escapes me where I made a mistake. Thank you for your