Commit 07b977dd authored by Jeremy Hylton's avatar Jeremy Hylton

Always abort a transaction that raised an exception.

parent ec6c4a89
......@@ -67,9 +67,10 @@ class SynchronizedStorage:
apply(self.assertRaises, args)
def verifyWrongTrans(self, callable, *args):
self._storage.tpc_begin(Transaction())
args = (StorageTransactionError, callable) + args
apply(self.assertRaises, args)
t = Transaction()
self._storage.tpc_begin(t)
self.assertRaises(StorageTransactionError, callable, *args)
self._storage.tpc_abort(t)
def checkAbortVersionNotCommitting(self):
self.verifyNotCommitting(self._storage.abortVersion,
......
......@@ -199,9 +199,12 @@ class VersionStorage:
eq(zodb_unpickle(data), MinPO(54))
t = Transaction()
self._storage.tpc_begin(t)
self.assertRaises(POSException.VersionCommitError,
self._storage.commitVersion,
'one', 'one', t)
try:
self.assertRaises(POSException.VersionCommitError,
self._storage.commitVersion,
'one', 'one', t)
finally:
self._storage.tpc_abort(t)
def checkModifyAfterAbortVersion(self):
eq = self.assertEqual
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment