On Oct 10, 2008, at 8:03 AM, Heston James - Cold Beans wrote: > Morning guys, > > When calling object_session(my_object), it returns a NoneType object > so I’m unable to call commit() and close() on the session, what does > this mean? Does it mean my object is not attached to a session? > > My understanding is that if I did something like: > > my_object = session.query(object).get(object_id) > > then pass my_object around the application and wish to commit its > session I should be able to use the object_session() method to do > that? Is that not correct? >
that is all correct, however if you remove all strong references to the session, it gets garbage collected and the objects are detached. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---
