--On 4. Mai 2007 22:33:05 +0100 Laurence Rowe <[EMAIL PROTECTED]> wrote:

Following a discussion with several of the sqlalchemy integration authors
on #plone today we came up with the following hack to implement this:
http://dev.plone.org/collective/browser/collective.lead/trunk/collective/
lead/tx.py

The DataManager is given a high sortKey to ensure that it is considered
last, and commits in tpc_vote, before the other (2PC) DataManagers'
tpc_finish methods are called.

The hack obviously relies on only one DataManager making use of the
trick. It would be nice to make this was supported directly so that an a
error could be thrown when more than one 1PC DataManager joined a
transaction.

Well, the hack is really only a hack. As soon as more than one data manager is involved you'll run into the same problems. I have some apps with multiple SQL connections so this hack would give me nothing.


This could be implemented by changing the signature of
transaction._transaction.Transaction.join to have an optional
single_phase argument (default would be False). The 1PC resource would
then be registered seperately to the 2PC resources and _commitResources
would call commit on the 1PC resource between tpc_vote and tpc_finish.

If you think this would be helpful I'll try and supply a patch (need to
look into the detail of how failed transactions are cleaned up).

You could resolve this issue only if all subsystems participating in transaction could rollback a commit happened with this transaction in case of a data manager failing during its commit.

Andreas

Attachment: pgp2PTDD5Or7O.pgp
Description: PGP signature

_______________________________________________
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zodb-dev

Reply via email to