Commit 8f606cb0 authored by Jim Fulton's avatar Jim Fulton

Fixed bug in tpc_begin that caused the process to stop doing writes

if an attempt was made to write while disconnected from the storage
server.
parent c6cf1200
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
############################################################################## ##############################################################################
"""Network ZODB storage client """Network ZODB storage client
""" """
__version__='$Revision: 1.23 $'[11:-2] __version__='$Revision: 1.24 $'[11:-2]
import struct, time, os, socket, string, Sync, zrpc, ClientCache import struct, time, os, socket, string, Sync, zrpc, ClientCache
import tempfile, Invalidator, ExtensionClass, thread import tempfile, Invalidator, ExtensionClass, thread
...@@ -109,7 +109,6 @@ class ClientDisconnected(ClientStorageError): ...@@ -109,7 +109,6 @@ class ClientDisconnected(ClientStorageError):
"""The database storage is disconnected from the storage. """The database storage is disconnected from the storage.
""" """
class ClientStorage(ExtensionClass.Base, BaseStorage.BaseStorage): class ClientStorage(ExtensionClass.Base, BaseStorage.BaseStorage):
_connected=_async=0 _connected=_async=0
...@@ -458,8 +457,11 @@ class ClientStorage(ExtensionClass.Base, BaseStorage.BaseStorage): ...@@ -458,8 +457,11 @@ class ClientStorage(ExtensionClass.Base, BaseStorage.BaseStorage):
self._ts=t=t.laterThan(self._ts) self._ts=t=t.laterThan(self._ts)
id=`t` id=`t`
if not self._connected: raise ClientDisconnected() try:
try: r=self._call(self.__begin, id, user, desc, ext) if not self._connected:
raise ClientDisconnected(
"This action is temporarily unavailable.<p>")
r=self._call(self.__begin, id, user, desc, ext)
except: except:
self._commit_lock_release() self._commit_lock_release()
raise raise
...@@ -559,3 +561,4 @@ class ClientStorage(ExtensionClass.Base, BaseStorage.BaseStorage): ...@@ -559,3 +561,4 @@ class ClientStorage(ExtensionClass.Base, BaseStorage.BaseStorage):
self._lock_acquire() self._lock_acquire()
try: return self._call('versions', max) try: return self._call('versions', max)
finally: self._lock_release() finally: self._lock_release()
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