[Zope3-dev] Re: rdb: Disappearing Connection

Dieter Maurer dieter at handshake.de
Thu Dec 15 10:02:17 EST 2005


Jim Washington wrote at 2005-12-13 21:40 -0500:
> ...
>Now, looking closer at the code, a ping like this might be not too bad, 
>because isConnected() is only called when a connection is requested, not 
>for every SQL statement executed.  So, it might not be so onerous as 
>originally thought. Still not ideal, though.

Be careful what you do when you find that "isConnected()" returns false.
Note, that, in general, it would be a bug to just reopen a new connection
in this case: previous operations against the connection might have
been lost without notice when you simply reopen a new connection
and do as if nothing bad had happened.
Instead, you should reopen the connection and then raise an exception
similar to "ZODB.POSException.ConflictError". Hopefully, the publisher
will handle this kind of exception correctly (by retrying the complete
request).

-- 
Dieter


More information about the Zope3-dev mailing list