On Mar 23, 2010, at 9:29 AM, King Simon-NFHD78 wrote:
> object_session does indeed return the session that the instance is
> already bound to (so you shouldn't close it). I didn't know what
> object_session would return if the original session had been closed, so
> I tried it:

Thanks for looking into this for me.

As an update, I have been trying to use object_session but have been struggling 
with bugs related to the session returned from object_session() turning to 
None, presumably because it is somehow getting garbage collected.

Because of this, I am going to try to use scoped_session() as this seems to be 
the preferred method for keeping things simple and reliable with session 
sharing between disparate pieces of code. This way, all my code can create a 
"new" session but will end up getting the same session, thus solving the 
complexity of grabbing the current object's session (I hope.)

-Daniel

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to