[ZODB-Dev] Supporting a DataManager without Two Phase Commit
Andreas Jung
lists at zopyx.com
Fri May 4 21:05:06 EDT 2007
--On 5. Mai 2007 02:46:58 +0200 Andreas Jung <lists at zopyx.com> wrote:
>
> If commit fails or another DataManager fails, data is not commited to the
> database.
>
However I am not sure if this is completely true. Although this approach
ensures that all SQL statements were execute properly it does not take into
account that a commit operation itself might fail even at that point for
some reason. Even the Python DB API itself does not support the TPC and
most don't driver don't support TPC through an API. So that's basically a
flaw in the Python DB-API level. Even up2date drivers like psycopg2 for
Postgres don't support something like PREPARE TRANSACTION or COMMIT
PREPARED.
See also
<http://mail.zope.org/pipermail/zope3-users/2006-April/002949.html>
Looking back at your hack..it seems to introduce some more safety for a
particular usecase (perhaps general for people dealing only with one
database at a time).
But thanks for pointing out this problem. I'll change my code in
z3c.sqlalchemy in a similar way to gain at least a bit more safety.
Andreas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zodb-dev/attachments/20070505/ea2deb66/attachment-0001.bin
More information about the ZODB-Dev
mailing list