[Zope-DB] Problems with transaction management and many database adapters

M.-A. Lemburg mal at egenix.com
Thu Feb 5 17:06:20 EST 2004

Federico Di Gregorio wrote:
> Il gio, 2004-02-05 alle 19:29, Dieter Maurer ha scritto:
>>I tried (in our private Zope installation) to do error handling
>>in the same transaction as the main thread (as Toby suggested).
>>But I failed due to a "get_transaction().begin()" at the begin of error
>>handling (this calls an implicite "abort").
> my view on the problem is that inside error handling code you can't
> count on anything. db connection? can be fsck-ed. everything can be
> fsck-ed, so an almost static page with (hidden) debug info and (visible)
> excuses to the user is more than enough. zope is doing the right thing,
> it just need to advertise its behaviour so that nobody gets bitten
> again.

That's the quick&dirty solution :-)

Fortunately, Python can guard against
failures in the error handling code by making use of the powerful
exception handling mechanism -- you can even deal with memory
errors at such a level and still return useful information to
the user while trying to properly cleanup the error situation
so that the system can continue in a sane state.

It's less fun to program and the code won't look nice, but
given that the process will continue to run, you can not be
careful enough about cleaning up left over resources in error

Marc-Andre Lemburg

Professional Python Services directly from the Source  (#1, Feb 05 2004)
 >>> Python/Zope Consulting and Support ...        http://www.egenix.com/
 >>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
 >>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
2004-01-23: Released mxODBC.Zope.DA 1.0.8        http://zope.egenix.com/

::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::

More information about the Zope-DB mailing list