Re: [sqlalchemy] Query caching allows two objects representing same underlying data in session?

2013-07-16 Thread Claudio Freire
On Mon, Jul 15, 2013 at 8:02 PM, Michael Bayer mike...@zzzcomputing.com wrote: On Jul 15, 2013, at 4:51 PM, Amir Elaguizy aelag...@gmail.com wrote: I'm having this weird problem using the query caching recipes in which two instances of a model representing the same underlying dataset will

Re: [sqlalchemy] Query caching allows two objects representing same underlying data in session?

2013-07-16 Thread Michael Bayer
On Jul 16, 2013, at 1:47 PM, Claudio Freire klaussfre...@gmail.com wrote: On Mon, Jul 15, 2013 at 8:02 PM, Michael Bayer mike...@zzzcomputing.com wrote: On Jul 15, 2013, at 4:51 PM, Amir Elaguizy aelag...@gmail.com wrote: I'm having this weird problem using the query caching recipes in

Re: [sqlalchemy] Query caching allows two objects representing same underlying data in session?

2013-07-16 Thread Claudio Freire
On Tue, Jul 16, 2013 at 4:22 PM, Michael Bayer mike...@zzzcomputing.com wrote: To put a cached instance into a session, you must first copy it, then update. How to do that, is very application-specific, and I don't think it can be automated. that's what merge(don't_load=True) does. If

[sqlalchemy] Query caching allows two objects representing same underlying data in session?

2013-07-15 Thread Amir Elaguizy
I'm having this weird problem using the query caching recipes in which two instances of a model representing the same underlying dataset will both get into the session. I know this is happening because I put all of the models in a set() and there are two instances with the same underlying

Re: [sqlalchemy] Query caching allows two objects representing same underlying data in session?

2013-07-15 Thread Michael Bayer
On Jul 15, 2013, at 4:51 PM, Amir Elaguizy aelag...@gmail.com wrote: I'm having this weird problem using the query caching recipes in which two instances of a model representing the same underlying dataset will both get into the session. I know this is happening because I put all of the