Saga continues ([Zope-DB] DCOracle2: close connection doesn't)

Dieter Maurer dieter at handshake.de
Thu Oct 23 12:30:06 EDT 2003


Chris Withers wrote at 2003-10-22 22:46 +0100:
 > Dieter Maurer wrote:
 > 
 > > Zope does not drop the connection and it reexecutes the query or
 > > raises an exception when it notices that the connection has been
 > > dropped.
 > 
 > Where's the code that does this?

The code in traditionally in the method "query".

Note, that it should (but usually does not) raise an exception derived from
"ConflictError" rather than reexecute the query itself.
Reopening the connection means that the old transaction was
(implicitly) aborted and a new one started. You lost operations
performed in earlier queries.
Raising a "ConflictError" lets ZPublisher restart the thread.

 > (It doesn't always work, see the start of this thread ;-)

Because, your problem occured in "abort/commit".
This code traditionally ignores exceptions during the operation
-- a severe bug.

 > 
 > > However, the database server never detects that it waits for
 > > data from a cut connection. We have to restart the server
 > > regularly to get rid of the piling up defunct sessions.
 > 
 > This sounds familiar, although one of the problems I'm trying to solve is 
 > sockets piling up in a CLOSED_WAIT state on the Oracle(or maybe Zope?) server. 
 > They go away when the ZODB cache is minimized...

Ours stay, even when Zope is restarted (because the firewall
had cut the connection a long time ago).


Dieter



More information about the Zope-DB mailing list