On Saturday 05 August 2006 01:47, you wrote: > On Aug 4, 2006, at 7:24 AM, Tzahi Fadida wrote: > >> you can always make your own subclass of Session / SessionTransaction > >> that checks some kind of timeout value upon the next operation. > >> SessionTransaction is not really designed to be held open for > >> arbitrary amounts of time, though. > > > > I think that this is not the problem though. When the thread is > > finished > > or i do del transaction. The connection is still being occupied by the > > transaction, even if the session is non-existant. Perhaps something > > like > > __del__ in session is needed? > > no, you should do it like the docs say, where all explicit > SessionTransaction code uses a try:/finally: block that insures that > either trans.commit() or trans.rollback() is called. theres no > default "close" operation for an open transaction.
I am not saying there has to be close/rollback/commit, however, i am convinced that when a transaction/sessionTransaction object is non existant anymore, then at least the connection must be freed. i.e. it just occupies memory and a slot in the pool. It is just like a memory leak and a resource leak. What i suggest is that the __del__ or whatever will check if the transaction was unresolved and just free the connection. The database will decide what to do next, SQLAlchemy is supposed to be an API/link to the database. I.e., this has nothing to do with transactions and more about freeing defunct resources you can no longer access. -- Regards, Tzahi. -- Tzahi Fadida Blog: http://tzahi.blogsite.org | Home Site: http://tzahi.webhop.info WARNING TO SPAMMERS: see at http://members.lycos.co.uk/my2nis/spamwarning.html ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Sqlalchemy-users mailing list Sqlalchemy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users