[Zope-DB] Closing idle DCoracle2 Connections?
dieter at handshake.de
Thu Oct 20 16:26:46 EDT 2005
Germer, Carsten wrote at 2005-10-20 11:16 +0200:
>As we start to use our zope-Ora connection more frequently our database
>administrator complains that he sees a lot of idle conections.
>I know theres "connection.close()" in DCOra2 but does anyone know of a
>way to autmatically close a DCOra within Zope when idle soandso long? Or
>any other way to adress such a problem?
Modulo bugs, the connection will be closed when
the DA object is flushed from the ZODB cache.
The ZODB cache is controlled by a maximal size (number of objects)
and replaces objects with a least recently used policy.
Usually, there is not need for a sophisticated connection
management. Just do not create unnecessary DA instances.
Modulo bugs, the total number of needed connections
is number of DA objects times the number of worker threads.
If you see more open connections than this value, you see a bug.
Bugs should be fixed and not worked around with more complex
software (complex connection management).
>I know that I wouldn't want the connection being closed from Oracles
>side as I have read in the mailinglist that DCOracle would still think
>the connection is open and generate an error.
The DA catches OperationalErrors and reopens the connection.
It tries to do this transparently (though a bit wrong).
More information about the Zope-DB