[Zodb-checkins] CVS: StandaloneZODB/bsddb3Storage/bsddb3Storage - Full.py:1.40.2.3
Barry Warsaw
barry@wooz.org
Thu, 6 Jun 2002 18:40:13 -0400
Update of /cvs-repository/StandaloneZODB/bsddb3Storage/bsddb3Storage
In directory cvs.zope.org:/tmp/cvs-serv5055/bsddb3Storage/bsddb3Storage
Modified Files:
Tag: bsddb3Storage-picklelog-branch
Full.py
Log Message:
Re-fixed a buglet that somehow didn't make it in on the branch.
_finish(): the key/values were reversed in the loop over serials.
_log_object(): Uses referencesf() instead of fast_pickle_dumps(),
although the import of the latter is retained for performance testing
purposes.
Also, add a note to the debugging serial numbers that tests like undo
and packing will fail with them.
=== StandaloneZODB/bsddb3Storage/bsddb3Storage/Full.py 1.40.2.2 => 1.40.2.3 ===
self.__nextvid = 0L
# DEBUGGING
+ # NOTE: some tests will fail if you enable debugging serial numbers
+ # because it breaks the default assumption that serial numbers are
+ # timestamps. Things like packing and undoing will break.
#self._nextserial = 0L
#self.profiler = hotshot.Profile('profile.dat', lineevents=1)
@@ -350,9 +353,9 @@
finally:
c.close()
# It's actually faster to boogie through this list twice
- for tid, oid in serials:
+ for oid, tid in serials:
self._txnoids.put(tid, oid, txn=txn)
- for tid, oid in serials:
+ for oid, tid in serials:
self._serials.put(oid, tid, txn=txn)
for key, data in metadata:
self._metadata.put(key, data, txn=txn)
@@ -725,20 +728,16 @@
return self._serial
def _log_object(self, oid, vid, nvrevid, data, oserial):
-
# Save data for later commit. We do this by writing the pickle
# directly to BDB and saving the pickle key in the pickle log.
# We extract the references and save them in the transaction log.
-
+ #
# Get the references
refdoids = []
- referencesf(pickle, refdoids)
- refdoids = fast_pickle_dumps(refdoids)
-
+ referencesf(data, refdoids)
# Record the update to this object in the commit log.
self._commitlog.write_object(oid, vid, nvrevid, refdoids, oserial)
-
- # Save the pickle in the database:
+ # Save the pickle in the database
txn = self._env.txn_begin()
try:
key = oid + self._serial