[Zope3-checkins] CVS: Zope3/src/ZODB - MappingStorage.py:1.12.2.1
Jeremy Hylton
jeremy at zope.com
Wed Mar 31 17:06:48 EST 2004
Update of /cvs-repository/Zope3/src/ZODB
In directory cvs.zope.org:/tmp/cvs-serv16498/src/ZODB
Modified Files:
Tag: jeremy-txn-branch
MappingStorage.py
Log Message:
Add getTid() method.
The ZEO tests were calling getTid() and getting an error, but these
errors didn't cause any tests to fail. Don't know off the top of my
head what was going on, but it doesn't hurt to have a getTid() method.
=== Zope3/src/ZODB/MappingStorage.py 1.12 => 1.12.2.1 ===
--- Zope3/src/ZODB/MappingStorage.py:1.12 Thu Mar 11 15:10:55 2004
+++ Zope3/src/ZODB/MappingStorage.py Wed Mar 31 17:06:47 2004
@@ -68,6 +68,16 @@
finally:
self._lock_release()
+ def getTid(self, oid):
+ self._lock_acquire()
+ try:
+ # The tid is the first 8 bytes of the buffer.
+ s = self._index[oid]
+ return s[:8]
+ finally:
+ self._lock_release()
+
+
def store(self, oid, serial, data, version, transaction):
if transaction is not self._transaction:
raise POSException.StorageTransactionError(self, transaction)
More information about the Zope3-Checkins
mailing list