[ZODB-Dev] Problem with Bsddb3Storage.copyTransactionsFrom

Toby Dickenson tdickenson@geminidataloggers.com
Mon, 05 Nov 2001 10:59:13 +0000


On Fri, 2 Nov 2001 13:46:42 -0500, barry@zope.com (Barry A. Warsaw)
wrote:

>
>>>>>> "JH" =3D=3D Jeremy Hylton <jeremy@zope.com> writes:
>
>    JH> I believe None is passed to store() when an object is created.
>
>This is interesting.
>
>Our current test suite assumes that serial will be ZERO (i.e. '\0'*8)
>for an object creation store() call.  Berkeley assumes the same
>thing.  If I'm reading FileStorage.store() correctly, I think it will
>work in either case.  The storage interface specification is silent on
>this.

There is a parallel problem in TmpStore.py, which is used by
subtransactions.

Ive been using the patch below for three months (and I guess it was
lost in The Collector tragedy)


Index: TmpStore.py
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file:
/home/cvs/development/external/Zope2/lib/python/ZODB/TmpStore.py,v
retrieving revision 1.1.1.3
retrieving revision 1.3
diff -c -4 -r1.1.1.3 -r1.3
*** TmpStore.py 10 Sep 2001 14:55:05 -0000      1.1.1.3
--- TmpStore.py 10 Sep 2001 15:32:28 -0000      1.3
***************
*** 137,144 ****
--- 137,146 ----

      def store(self, oid, serial, data, version, transaction):
          if transaction is not self._transaction:
              raise POSException.StorageTransactionError(self,
transaction)
+         if serial is None:
+             serial =3D '\0\0\0\0\0\0\0\0'
          file=3Dself._file
          pos=3Dself._pos
          file.seek(pos)
          l=3Dlen(data)


Toby Dickenson
tdickenson@geminidataloggers.com