[Zope-CVS] CVS: Products/AdaptableStorage/serial - ObjectGateway.py:1.2
Shane Hathaway
shane@zope.com
Tue, 3 Dec 2002 18:11:24 -0500
Update of /cvs-repository/Products/AdaptableStorage/serial
In directory cvs.zope.org:/tmp/cvs-serv22143/serial
Modified Files:
ObjectGateway.py
Log Message:
Running AdaptableStorage with the latest Zope revealed some flaws.
Fixed them all.
- Consistent ordering of transaction participants now makes it impossible to
add a jar to the transaction after the commit() method has begun.
AdaptableStorage (and perhaps other projects like ZPatterns) relied on
the ability to add a jar after commit has started. This could lead to
a deadlock. Reworked ASStorage, FSConnection, and the tests to deal with
this.
- Serials are now required to be hashable. This makes serials, used to
prevent conflicts, simpler and more robust.
- DBTab needs some kind of class it can call directly, so I added
the small subclasses FSStorage and FSDatabase to Zope2FS.
- Restored the PersistentExtra patch.
- The directory items gateway wants to write data about its children, but
sometimes its children aren't being written at the same time. Added
a "conditional" optional flag to FSConnection.writeSection(), allowing
data to be written only if other data gets written.
=== Products/AdaptableStorage/serial/ObjectGateway.py 1.1 => 1.2 ===
--- Products/AdaptableStorage/serial/ObjectGateway.py:1.1 Wed Nov 27 13:37:06 2002
+++ Products/AdaptableStorage/serial/ObjectGateway.py Tue Dec 3 18:10:53 2002
@@ -61,7 +61,7 @@
serials[name] = serial
serials = serials.items()
serials.sort()
- return full_state, serials
+ return full_state, tuple(serials)
def store(self, object_mapper, key, full_state):
"""Stores data.
@@ -71,12 +71,13 @@
serials = {}
for name, gw in self._gws.items():
state = full_state.get(name)
+ # print 'gateway storing', key, name, state
serial = gw.store(object_mapper, key, state)
assert serial is not None
serials[name] = serial
serials = serials.items()
serials.sort()
- return serials
+ return tuple(serials)
def makeKey(self, event, name, stored):
# By default, use simple path-based keys