On Friday 04 August 2006 08:29, Michael Bayer wrote:
> 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.

Thank you, that one is fixed. One remain, see below.

>
> >> 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.

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?

>
> > 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)

-- 
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

Reply via email to