Jeremy Hylton wrote:
That would be fine. We only need all tests (including the new test) to pass. :-)On Tue, 2003-02-11 at 12:10, Shane Hathaway wrote:I added a test to testZODB.py on a new branch (shane-conflict-handling-branch) that exercises the conflict handling bug. The test currently fails. It might be simpler to go with Toby's implementation for now: add a "veto" object to the transaction that refuses any attempt to commit. But maybe your transaction states are better. Let me know what you want to do.
I'd like to do the transaction states, because it would keep the code in zodb3 and zodb4 similar. Unless there's a reason to think there are problems with the transaction state approach.
If we have veto(), it should probably expect a string argument that explains the reason for the veto. Then if something tries to commit, we can raise VetoedError(explanation). Otherwise, it seems like failed transactions would be opaque and hard to decipher.I didn't look carefully at the test, but if I remember the discussion last time around, the problem is with read conflicts caught outside of 2PC. In that case, we either need to mark the connection so that it votes no when it gets to prepare() or we need to veto() method. I'd prefer the vote-no-in-prepare because it keeps the API smaller, but veto() isn't so bad; maybe it's better to stop the transaction quickly.
Having said that, now it seems like marking the connection instead is the better way to go. It would require no changes to the transaction machinery, so no backporting would be necessary.
Zope-Dev maillist - [EMAIL PROTECTED]
** No cross posts or HTML encoding! **
(Related lists - http://mail.zope.org/mailman/listinfo/zope-announce