[Zodb-checkins] CVS: StandaloneZODB/ZEO - StorageServer.py:1.44

Jeremy Hylton jeremy@zope.com
Mon, 12 Aug 2002 15:42:41 -0400


Update of /cvs-repository/StandaloneZODB/ZEO
In directory cvs.zope.org:/tmp/cvs-serv12190

Modified Files:
	StorageServer.py 
Log Message:
Make sure current transaction is aborted on close.

XXX This makes CommitLockTests pass on Win2k for me.


=== StandaloneZODB/ZEO/StorageServer.py 1.43 => 1.44 ===
--- StandaloneZODB/ZEO/StorageServer.py:1.43	Mon Aug 12 14:27:14 2002
+++ StandaloneZODB/ZEO/StorageServer.py	Mon Aug 12 15:42:40 2002
@@ -115,6 +115,8 @@
                 removed = 1
 
 class ZEOStorage:
+    """Proxy to underlying storage for a single remote client."""
+    
     def __init__(self, server):
         self.server = server
         self.client = None
@@ -124,6 +126,11 @@
         self._transaction = None
 
     def close(self):
+        # When this storage closes, we must ensure that it aborts
+        # any pending transaction.  Not sure if this is the clearest way.
+        if self._transaction is not None:
+            self.__storage.tpc_abort(self._transaction)
+            self._transaction is None
         self._conn.close()
 
     def notifyConnected(self, conn):