[Zope-Checkins] CVS: Zope2 - BaseStorage.py:1.13
Jim Fulton
jim@digicool.com
Thu, 12 Apr 2001 15:50:17 -0400 (EDT)
Update of /cvs-repository/Zope2/lib/python/ZODB
In directory korak:/tmp/cvs-serv24456
Modified Files:
BaseStorage.py
Log Message:
It's legal to call tpc_vote and tpc_finish multiple times.
Unfortutely, tpc_finish didn't handle this case correctly.
--- Updated File BaseStorage.py in package Zope2/lib/python/ZODB --
--- BaseStorage.py 2001/04/03 18:08:51 1.12
+++ BaseStorage.py 2001/04/12 19:50:16 1.13
@@ -213,15 +213,17 @@
self._lock_acquire()
try:
if transaction is not self._transaction: return
- if f is not None: f()
+ try:
+ if f is not None: f()
- u,d,e=self._ude
- self._finish(self._serial, u, d, e)
- self._clear_temp()
+ u,d,e=self._ude
+ self._finish(self._serial, u, d, e)
+ self._clear_temp()
+ finally:
+ self._ude=None
+ self._transaction=None
+ self._commit_lock_release()
finally:
- self._ude=None
- self._transaction=None
- self._commit_lock_release()
self._lock_release()
def _finish(self, tid, u, d, e):
--- Updated File BaseStorage.py in package Zope2 --
--- BaseStorage.py 2001/04/03 18:08:51 1.12
+++ BaseStorage.py 2001/04/12 19:50:16 1.13
@@ -213,15 +213,17 @@
self._lock_acquire()
try:
if transaction is not self._transaction: return
- if f is not None: f()
+ try:
+ if f is not None: f()
- u,d,e=self._ude
- self._finish(self._serial, u, d, e)
- self._clear_temp()
+ u,d,e=self._ude
+ self._finish(self._serial, u, d, e)
+ self._clear_temp()
+ finally:
+ self._ude=None
+ self._transaction=None
+ self._commit_lock_release()
finally:
- self._ude=None
- self._transaction=None
- self._commit_lock_release()
self._lock_release()
def _finish(self, tid, u, d, e):