Re: [sqlalchemy] Questions about session

2010-06-03 Thread Michael Bayer
On Jun 3, 2010, at 1:24 AM, Az wrote: +++ Questions +++ 1. Is this the correct way to use sessions or am I sort of abusing them? I dont see any poor patterns of use above. 2. When should I close a session? when you no longer need the usage of any of the objects associated with it, or

[sqlalchemy] Questions about session

2010-06-02 Thread Az
In my code, I am currently adding to the session in various modules (this is the same session since I'm importing it from my most prominent module). Some sample code would be: ## BEGIN CODE 1 ### Session = sessionmaker(bind=engine) session = Session() def addToTable(): Very