[ZPatterns] ZPatterns 0.4.3 final for Zope 2.3.x released
Phillip J. Eby
[email protected]
Thu, 19 Jul 2001 18:40:50 -0500
At 06:46 PM 7/19/01 +1000, Itai Tavor wrote:
>Ok, I'm finally back working on my ZPatterns projects, and I'm sorry to
>say that this is still broken. Earlier today I created and populated a
>Specialist using Zope 2.3.2 and ZPatterns 0.4.3b2. Then I upgraded to
>ZPatterns 0.4.3p1, verified that line 421 in Rack.py reads 'getItem(k)'
>and packed the Rack. All data disappeared.
>
>Not nice... what's going on? Am I using an unsupported/untested setup? I'm
>pretty sure I shouldn't have to use 2.3.3, everything else in 2.3.2 works
>fine and I think the new BTrees have been around since 2.3.
In the interests of getting this fixed quickly, perhaps you could try the
following patch for me? That way we can avoid the additional delay of you
sending me your data. I think the problem is that once the new BTrees
storage is created, the Rack appears to be empty and thus nothing is copied
into the new storage. If that's the case, this affects all ZPatterns
users, not just on Zope 2.3.2.
Index: Rack.py
===================================================================
RCS file: /cvsroot/ZProducts/ZPatterns/Rack.py,v
retrieving revision 1.81
diff -u -r1.81 Rack.py
--- Rack.py 2001/07/11 16:25:27 1.81
+++ Rack.py 2001/07/19 23:35:14
@@ -416,6 +416,7 @@
del self.__writeableStorage # force a new one to be created
new = self.__writeableStorage
+ self.__readableStorage = old
c=0
for k,v in old.items():
if self.getItem(k) is None: continue
@@ -425,6 +426,7 @@
get_transaction().commit(1)
old._p_jar.cacheMinimize(3)
+ self.__readableStorage = new
get_transaction().commit(1)
old._p_jar.cacheMinimize(3)