You are not logged in Log in Join
You are here: Home » Collectors » Adaptable Persistence Engine » Double read of files » doubleload.diff

Log in
Name

Password

 

doubleload.diff

Ape will read data 2 times from storage. First time in zodb3.connection.__getitem__ and then in zodb3.connection.setstate. I have put small patch that fixes this problem but it changes interface of Storage class with is NOT a good idea. See attached file.
File details
Size
1 K
File type
text/plain

File contents

diff -w -b -r1.1 zodb3/connection.py
78c78
<         p, serial = self._storage.load(oid, self._version)
---
>         p, serial = self._storage.load(oid, self._version, mappers_only=1)

diff -w -b -r1.1 zodb3/storage.py
89c89
<     def _load(self, root_mapper, keychain, hash_only=0):
---
>     def _load(self, root_mapper, keychain, hash_only=0, mappers_only=0):
104a105,108
> 
>         if mappers_only :
>             full_state, hash_value = None, None
>         else :
105a110
> 
109c114
<     def load(self, oid, version):
---
>     def load(self, oid, version, mappers_only=0):
117c122
<                 root_mapper, keychain)
---
>                 root_mapper, keychain, mappers_only=mappers_only)
120a126,129
> 
>             if mappers_only :
>                 h = 0
>             else :
122d130
<             data = file.getvalue()
125a134,135
> 
>             data = file.getvalue()

diff -w -b -r1.1 zope2/Setup/TmpStore.py
53c53
<     def load(self, oid, version):
---
>     def load(self, oid, version, **kw):
56c56
<             return self._storage.load(oid, self._bver)
---
>             return self._storage.load(oid, self._bver, **kw)