[Zope-Checkins] CVS: Zope/lib/python/Shared/DC/ZRDB - TM.py:1.8.34.1
Casey Duncan
casey@zope.com
Wed, 27 Mar 2002 15:51:54 -0500
Update of /cvs-repository/Zope/lib/python/Shared/DC/ZRDB
In directory cvs.zope.org:/tmp/cvs-serv22094/lib/python/Shared/DC/ZRDB
Modified Files:
Tag: casey-death_to_index_html-branch
TM.py
Log Message:
Updating branch to head for testing
=== Zope/lib/python/Shared/DC/ZRDB/TM.py 1.8 => 1.8.34.1 ===
get_transaction().register(Surrogate(self))
self._begin()
- self._registered=1
+ self._registered = 1
+ self._finalize = 0
except: pass
def tpc_begin(self, *ignored): pass
- commit=tpc_abort=tpc_begin
+ commit=tpc_begin
def _finish(self):
self.db.commit()
@@ -46,13 +47,20 @@
def _abort(self):
self.db.rollback()
+ def tpc_vote(self, *ignored):
+ self._finalize = 1
+
def tpc_finish(self, *ignored):
- try: self._finish()
- finally: self._registered=0
+
+ if self._finalize:
+ try: self._finish()
+ finally: self._registered=0
def abort(self, *ignored):
try: self._abort()
finally: self._registered=0
+
+ tpc_abort = abort
class Surrogate: