[ZODB-Dev] Maximum pool size considered harmful

Martin Kretschmar kretschmar at infoman.de
Mon May 3 10:43:19 EDT 2004


Hello,

I welcome:

> - Keep a weak-key dictionary (weak set?) of connections
>    so we can do things like compute connection and
>    cache statistics
>
> - Keep a stack of unused connections, for reuse
> 
> - When someone calls open(), if the unused connection stack is
>   non-empty, they'll get the connection from the top of the stack,
>   otherwise they'll get a new connection.
>
> - When someone closes a connection, the connection will be
>   added to the top of the stack. If the stack is over a maximum size,
>   connections are discarded from the bottom of the stack (ie deck).

but the implementation should be a little bit more
thread aware.

I once had hard to trace ODBC access violations under
load and after 1-2 days. The problem was a recycled
CDatabase object. After I gave every thread his "own"
object back, the problem was gone.

Creating a session to an Oracle data base can also be
quite a pain, since it takes at least 5 seconds. So
it is a good idea to be able to keep sessions open
and at the same time being able to enforce their
closure.

Regards,
         Martin



More information about the ZODB-Dev mailing list