[Zope-DB] DA's violating transactional assertions
Fri, 24 Jan 2003 23:03:45 +0100
Federico Di Gregorio wrote at 2003-1-24 10:27 +0100:
> Il ven, 2003-01-24 alle 04:12, Robert Kellock ha scritto:
> > Which ones?
> ZpsycopgDA for sure (right Dieter? :) and probably ZOracleDA (from which
> ZPsycopgDA was derived), ZPoPyDA and maybe even the mysql adapter (but i
> can be wrong here.)
> i completely agree with Dieter's analisys and i'll try to fix the
> problem in the 1.1 series. the problem is: does zope provides such a
> "special exception"?
The "retry" logic is implemented in "Zope/__init__.py:zpublisher_exception_hook".
As it is, it retries on any subclass of "ZODB.POSException.ConflictError".
Of course, when it really were necessary, it could be extended.
But, the current case would not make this necessary.
The DA could simply derive an appropriate exception
from "ZODB.POSException.ConflictError" and use that
for its transient errors.
We may get cleaner code across DA's when we define a standard
DATransientError. It should clearly state, which DA instance (path)
got the problem and what was the original exception (which
we converted into a "DATransientError").
On alternative to such an information rich exception would
be to log the original exception (not a bad idea anyway).