[Zope-DB] Re: Trying to catching ZPsycopg exceptions aborts the transaction

Dieter Maurer dieter at handshake.de
Wed Dec 1 11:04:52 EST 2004


Josef Meile wrote at 2004-11-30 13:12 +0100:
> ...
>>>I know it may sound strange, but I don't want the DA to abort the
>>>transaction when trying to insert a duplicate record.
> ...
>Just think about it:

I know, I never would do it -- as it is very dangerous.

That said:

   Zope aborts the transaction when an exception reaches
   ZPublisher. This does not happen when you catch the exception before.


However, I have observed an "auto-abort" behaviour of Postgres
(via "psycopg"): when an error occurred, Postgres refused
to do any more commands until the transaction was explicitely
aborted.

In my view, this is very senseful behaviour (as it is likely,
that internal data structures are already inconsistent).

It would make your approach unfeasible.

-- 
Dieter


More information about the Zope-DB mailing list