[ZODB-Dev] Maximum pool size considered harmful

Martin Kretschmar kretschmar at infoman.de
Fri May 14 07:19:14 EDT 2004


The creation of a session to an Oracle database
takes 5 seconds via ODBC. This is also true for
the ADO.Net world when the requestes are routed
towards the ODBC layer. So its a good idea to
be able to "close" a session, but not really.

When a session is created, several objects are
most likely instantiated at several places in
the code. We have access to some of this code,
but not to everything. The thing that is most
likely to continue to work, is to let a thread,
as a precaution, continue to work on his objects
himself.

So depending on the database, sometimes we need
to perform a true close, sometimes not etc. So
it would be nice to have cache of database
connections, but the concrete behavior should
be adaptable during runtime.

> Doing so simplifies application code avoids a
> whole class of bugs.  Connections *should* be
> able to be garbage collected if application
> code stops using them.
> 
> Applications that don't care about reusing
> connections needn't bother closing them.
> OTOH, applications that do care, like Zope,
> will continue to use close.

Exactly. And that is "cache management" for me.

Martin



More information about the ZODB-Dev mailing list