On Aug 3, 2006, at 1:22 PM, Tzahi Fadida wrote: > > I am pretty convinced this is a bug. > The normal way it should have worked is that all the new sessions > should > have got the timeouts exception. The reason they did not is because > suddenly after a few timeout exceptions, SQLAlchemy breaks the policy > and tries to open new connections overflowing the overflow :), which > triggers this message "OperationalError: FATAL: sorry, too many > clients > already" eventually (but that's after the bug of new connections). >
If you create test programs, please send them in their complete, dependency-free, and fully working form along with the problem, as in this case I had to recreate the threaded behavior myself with your issue since you only sent a fragment of your test. ( i have no way of knowing the nature of any bug without being able to run a test program that illustrates it). Anyway, there was a patch introduced in ticket 224 that played around with the overflow counter for invalid connections in such a way as to create this problem, so this bug is now fixed in changeset 1761. >> >> Also two questions: >>> - Can i set a timeout for a transaction or the time a session can >>> occupy >>> a connection? >> 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. > > How do i know which connection a session is operating on? > conn = session.connection(mapper_in_question).connection >> - how do i associate a session to a pool (for example, i assign a >> pool for >> someengine = create_engine(pool=somepool) s = create_session(bind_to=someengine) ------------------------------------------------------------------------- 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