Commit 6b85a572 authored by Jim Fulton's avatar Jim Fulton Committed by GitHub

Merge pull request #64 from zopefoundation/register-returns-last-transaction

- The ZEO server register method now returns the storage last transaction
parents 3ae6ff6d 2d8e7153
Changelog Changelog
========= =========
- The ZEO server register method now returns the storage last
transaction, allowing the client to avoid an extra round trip during
cache verification.
- Client disconnect errors are now transient errors. When - Client disconnect errors are now transient errors. When
applications retry jobs that raise transient errors, jobs (e.g. web applications retry jobs that raise transient errors, jobs (e.g. web
requests) with disconnect errors will be retried. Together with requests) with disconnect errors will be retried. Together with
......
...@@ -222,6 +222,8 @@ class ZEOStorage: ...@@ -222,6 +222,8 @@ class ZEOStorage:
self.stats = self.server.register_connection(storage_id, self) self.stats = self.server.register_connection(storage_id, self)
self.lock_manager = self.server.lock_managers[storage_id] self.lock_manager = self.server.lock_managers[storage_id]
return self.lastTransaction()
def get_info(self): def get_info(self):
storage = self.storage storage = self.storage
......
...@@ -831,7 +831,8 @@ Now we'll open a storage server on the data, simulating a restart: ...@@ -831,7 +831,8 @@ Now we'll open a storage server on the data, simulating a restart:
>>> sv = StorageServer(None, dict(fs=fs)) >>> sv = StorageServer(None, dict(fs=fs))
>>> s = ZEOStorage(sv, sv.read_only) >>> s = ZEOStorage(sv, sv.read_only)
>>> s.notify_connected(FauxConn()) >>> s.notify_connected(FauxConn())
>>> s.register('fs', False) >>> s.register('fs', False) == fs.lastTransaction()
True
If we ask for the last transaction, we should get the last transaction If we ask for the last transaction, we should get the last transaction
we saved: we saved:
......
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