Re: [sqlalchemy] What exactly is the rationale behind manage the life cycle of the session externally to functions that deal with specific data.?
On 8/11/15 9:51 PM, Jinghui Niu wrote: In the Documentation -- Session Basics, I read this: E.g. don’t do this: ### this is the **wrong way to do it** ### class ThingOne(object): def go(self): session = Session() try:
[sqlalchemy] What exactly is the rationale behind manage the life cycle of the session externally to functions that deal with specific data.?
In the Documentation -- Session Basics, I read this: E.g. don’t do this: ### this is the **wrong way to do it** ### class ThingOne(object): def go(self): session = Session() try: session.query(FooBar).update({x: 5}) session.commit()