<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<id>tag:old.nabble.com,2006:forum-6714</id>
	<title>Nabble - Zope - ZODB-Dev</title>
	<updated>2009-12-17T16:03:25Z</updated>
	<link rel="self" type="application/atom+xml" href="http://old.nabble.com/Zope---ZODB-Dev-f6714.xml" />
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Zope---ZODB-Dev-f6714.html" />
	<subtitle type="html">Zope Object Database Development List</subtitle>
	
<entry>
	<id>tag:old.nabble.com,2006:post-26837158</id>
	<title>Re: Locating backrefs of persistent objects</title>
	<published>2009-12-17T16:03:25Z</published>
	<updated>2009-12-17T16:03:25Z</updated>
	<author>
		<name>Shane Hathaway</name>
	</author>
	<content type="html">Marius Gedminas wrote:
&lt;br&gt;&amp;gt; I'd like to implement the following feature for zodbbrowser: given a
&lt;br&gt;&amp;gt; persistent object X, find all other persistent objects that have
&lt;br&gt;&amp;gt; references to it.
&lt;br&gt;&lt;br&gt;RelStorage has this functionality, but I don't know how we ought to 
&lt;br&gt;expose it. &amp;nbsp;Start a pack to update the graph, then query the object_ref 
&lt;br&gt;table. &amp;nbsp;Turn on pack-dry-run if you only want to update the table and 
&lt;br&gt;don't want to pack.
&lt;br&gt;&lt;br&gt;I'd like to make RelStorage implement some Python API for listing 
&lt;br&gt;backreferences, but no such API has been defined.
&lt;br&gt;&lt;br&gt;Shane
&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;For more information about ZODB, see the ZODB Wiki:
&lt;br&gt;&lt;a href=&quot;http://www.zope.org/Wikis/ZODB/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.zope.org/Wikis/ZODB/&lt;/a&gt;&lt;br&gt;&lt;br&gt;ZODB-Dev mailing list &amp;nbsp;- &amp;nbsp;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26837158&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ZODB-Dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.zope.org/mailman/listinfo/zodb-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.zope.org/mailman/listinfo/zodb-dev&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Locating-backrefs-of-persistent-objects-tp26834949p26837158.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26835302</id>
	<title>Re: Locating backrefs of persistent objects</title>
	<published>2009-12-17T13:30:58Z</published>
	<updated>2009-12-17T13:30:58Z</updated>
	<author>
		<name>Jim Fulton</name>
	</author>
	<content type="html">On Thu, Dec 17, 2009 at 4:06 PM, Marius Gedminas &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26835302&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;marius@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; I'd like to implement the following feature for zodbbrowser: given a
&lt;br&gt;&amp;gt; persistent object X, find all other persistent objects that have
&lt;br&gt;&amp;gt; references to it.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; My use case for this is debugging: e.g. given a log entry that mentions
&lt;br&gt;&amp;gt; a conflict error about an OOBTreeBucket, I'd like to know which OOBTree
&lt;br&gt;&amp;gt; object contains it, and what object wraps the OOBTree, and at that point
&lt;br&gt;&amp;gt; I usually see a container with a __name__ and __parent__ and can figure
&lt;br&gt;&amp;gt; out what's going on.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I realize that ZODB doesn't keep track of backreferences, so the only
&lt;br&gt;&amp;gt; way to get that is to do a full object traversal, which is expensive in
&lt;br&gt;&amp;gt; both CPU and memory.
&lt;/div&gt;&lt;br&gt;...
&lt;br&gt;&lt;br&gt;&amp;gt; ?  Is there existing code I could use for inspiration?  zodbex?  zc.zodbgc?
&lt;br&gt;&amp;gt; Bits and pieces of ZODB itself?
&lt;br&gt;&lt;br&gt;zc.zodbdgc's multi-zodb-check-refs script will optionally produce a database
&lt;br&gt;of reverse references that your browser could use.
&lt;br&gt;&lt;br&gt;Note that building this database can take a very long time.
&lt;br&gt;&lt;br&gt;Jim
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Jim Fulton
&lt;br&gt;_______________________________________________
&lt;br&gt;For more information about ZODB, see the ZODB Wiki:
&lt;br&gt;&lt;a href=&quot;http://www.zope.org/Wikis/ZODB/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.zope.org/Wikis/ZODB/&lt;/a&gt;&lt;br&gt;&lt;br&gt;ZODB-Dev mailing list &amp;nbsp;- &amp;nbsp;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26835302&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ZODB-Dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.zope.org/mailman/listinfo/zodb-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.zope.org/mailman/listinfo/zodb-dev&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Locating-backrefs-of-persistent-objects-tp26834949p26835302.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26834949</id>
	<title>Locating backrefs of persistent objects</title>
	<published>2009-12-17T13:06:27Z</published>
	<updated>2009-12-17T13:06:27Z</updated>
	<author>
		<name>Marius Gedminas-4</name>
	</author>
	<content type="html">I'd like to implement the following feature for zodbbrowser: given a
&lt;br&gt;persistent object X, find all other persistent objects that have
&lt;br&gt;references to it.
&lt;br&gt;&lt;br&gt;My use case for this is debugging: e.g. given a log entry that mentions
&lt;br&gt;a conflict error about an OOBTreeBucket, I'd like to know which OOBTree
&lt;br&gt;object contains it, and what object wraps the OOBTree, and at that point
&lt;br&gt;I usually see a container with a __name__ and __parent__ and can figure
&lt;br&gt;out what's going on.
&lt;br&gt;&lt;br&gt;I realize that ZODB doesn't keep track of backreferences, so the only
&lt;br&gt;way to get that is to do a full object traversal, which is expensive in
&lt;br&gt;both CPU and memory.
&lt;br&gt;&lt;br&gt;Given all that, what's the best (most efficient) way of computing the
&lt;br&gt;backreferences either for a single object, or for _all_ objects in the
&lt;br&gt;ZODB (that I could then cache for later use)?
&lt;br&gt;&lt;br&gt;&amp;nbsp; * implement something by hand, by using storage iterators and
&lt;br&gt;&amp;nbsp; &amp;nbsp; extracting forward references from each pickle
&lt;br&gt;&lt;br&gt;or
&lt;br&gt;&lt;br&gt;&amp;nbsp; * implement something by hand, by doing graph traversal (BFS/DFS)
&lt;br&gt;&amp;nbsp; &amp;nbsp; starting from the root object
&lt;br&gt;&lt;br&gt;or
&lt;br&gt;&lt;br&gt;&amp;nbsp; * reuse existing object graph traversal routines of the ZODB garbage
&lt;br&gt;&amp;nbsp; &amp;nbsp; collector
&lt;br&gt;&lt;br&gt;? &amp;nbsp;Is there existing code I could use for inspiration? &amp;nbsp;zodbex? &amp;nbsp;zc.zodbgc?
&lt;br&gt;Bits and pieces of ZODB itself?
&lt;br&gt;&lt;br&gt;The wishlist bug for this feature is here:
&lt;br&gt;&lt;a href=&quot;https://bugs.launchpad.net/zodbbrowser/+bug/497758&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://bugs.launchpad.net/zodbbrowser/+bug/497758&lt;/a&gt;&lt;br&gt;&lt;br&gt;Marius Gedminas
&lt;br&gt;-- 
&lt;br&gt;Linux don't need no steenkin' viruses. The users can destroy the
&lt;br&gt;system all by themselves....
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -- Peter Dalgaard in comp.os.linux.misc
&lt;br&gt;&lt;br /&gt; &lt;br /&gt;_______________________________________________
&lt;br&gt;For more information about ZODB, see the ZODB Wiki:
&lt;br&gt;&lt;a href=&quot;http://www.zope.org/Wikis/ZODB/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.zope.org/Wikis/ZODB/&lt;/a&gt;&lt;br&gt;&lt;br&gt;ZODB-Dev mailing list &amp;nbsp;- &amp;nbsp;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26834949&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ZODB-Dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.zope.org/mailman/listinfo/zodb-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.zope.org/mailman/listinfo/zodb-dev&lt;/a&gt;&lt;br&gt;&lt;div class=&quot;small&quot;&gt;&lt;br/&gt;&lt;img src=&quot;http://old.nabble.com/images/icon_attachment.gif&quot; &gt; &lt;strong&gt;signature.asc&lt;/strong&gt; (196 bytes) &lt;a href=&quot;http://old.nabble.com/attachment/26834949/0/signature.asc&quot; target=&quot;_top&quot;&gt;Download Attachment&lt;/a&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Locating-backrefs-of-persistent-objects-tp26834949p26834949.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26832713</id>
	<title>Re: ZODB 3.9/3.8 incompatibility (was Re: Data.fs size grows non-stop)</title>
	<published>2009-12-17T10:26:31Z</published>
	<updated>2009-12-17T10:26:31Z</updated>
	<author>
		<name>Kapil Thangavelu-5</name>
	</author>
	<content type="html">&lt;div&gt;On Thu, Dec 10, 2009 at 8:12 PM, Marius Gedminas &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26832713&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;marius@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;/div&gt;&lt;div class=&quot;gmail_quote&quot;&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;&quot;&gt;
&lt;div class=&quot;im&quot;&gt;On Thu, Dec 10, 2009 at 02:07:06PM -0500, Jim Fulton wrote:&lt;br&gt;
&amp;gt; On Thu, Dec 10, 2009 at 1:50 PM, Marius Gedminas &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26832713&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;marius@...&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;
&amp;gt; &amp;gt; On Thu, Dec 10, 2009 at 12:41:11PM -0500, Jim Fulton wrote:&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; On Thu, Dec 10, 2009 at 11:54 AM, Marius Gedminas &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26832713&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;marius@...&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; In 3.9 for FileStorage, if you give a starting tid that is toward the&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; end of the file,&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; it will scan backward, saving a lot of time.&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Ah, but how can I get a valid tid that is toward the end of the file?&lt;br&gt;
&amp;gt; &amp;gt; I assume that if I give a tid that doesn&amp;#39;t exist, I&amp;#39;ll get an error --&lt;br&gt;
&amp;gt; &amp;gt; which is the behavior oldstate() exhibits -- rather than the next&lt;br&gt;
&amp;gt; &amp;gt; existing transaction after that timestamp, or I could fudge by getting&lt;br&gt;
&amp;gt; &amp;gt; the current timestamp and subtracting 24 hours.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; No, the iterator starts at the first transactions who&amp;#39;s tid is &amp;gt;= the&lt;br&gt;
&amp;gt; start tid.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; So, guess a time and use repr(ZODB.TimeStamp.TimeStamp(...))&lt;br&gt;
&lt;br&gt;
&lt;/div&gt;Cool!  Thank you,&lt;br&gt;
&lt;br&gt;
Marius Gedminas&lt;br&gt;
&lt;font color=&quot;#888888&quot;&gt;--&lt;br&gt;&lt;/font&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;another way is to use the fstools.prev_txn starting at the end of the file  to grab the newest transactions, the script i send to the list last week uses it to poke a large zodb to just get the contents of the last 20 transactions without iterating through the whole thing or guessing a timestamp.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;&lt;/div&gt;&lt;a href=&quot;https://mail.zope.org/pipermail/zodb-dev/attachments/20091207/531fc1e4/attachment.obj&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.zope.org/pipermail/zodb-dev/attachments/20091207/531fc1e4/attachment.obj&lt;/a&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;
cheers,&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;kapil&lt;/div&gt;
&lt;br /&gt;_______________________________________________
&lt;br&gt;For more information about ZODB, see the ZODB Wiki:
&lt;br&gt;&lt;a href=&quot;http://www.zope.org/Wikis/ZODB/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.zope.org/Wikis/ZODB/&lt;/a&gt;&lt;br&gt;&lt;br&gt;ZODB-Dev mailing list &amp;nbsp;- &amp;nbsp;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26832713&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ZODB-Dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.zope.org/mailman/listinfo/zodb-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.zope.org/mailman/listinfo/zodb-dev&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/ZODB-3.9-3.8-incompatibility-%28was-Re%3A-Data.fs-size-grows-non-stop%29-tp26714772p26832713.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26830478</id>
	<title>Re: Python properties on Persistent objects</title>
	<published>2009-12-17T08:10:21Z</published>
	<updated>2009-12-17T08:10:21Z</updated>
	<author>
		<name>Mikko Ohtamaa</name>
	</author>
	<content type="html">&amp;gt;
&lt;br&gt;&amp;gt; Properties work with persistent objects with one limitation that I'm aware of.
&lt;br&gt;&amp;gt; The __setattribute__ method used by the persistent base class assumes
&lt;br&gt;&amp;gt; that any attribute assignment modifies the object's persistent state.
&lt;br&gt;&amp;gt; A property
&lt;br&gt;&amp;gt; that doesn't modify state or that modifies volatile state will fool
&lt;br&gt;&amp;gt; it. Conceivably,
&lt;br&gt;&amp;gt; one could override __setattribute__ to handle such properties, but doing so
&lt;br&gt;&amp;gt; would require great care. I don't recommend it.
&lt;br&gt;&lt;br&gt;Great, thanks! I already assumed so, but now this little feature is
&lt;br&gt;officially confirmed.
&lt;br&gt;&lt;br&gt;-Mikko
&lt;br&gt;_______________________________________________
&lt;br&gt;For more information about ZODB, see the ZODB Wiki:
&lt;br&gt;&lt;a href=&quot;http://www.zope.org/Wikis/ZODB/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.zope.org/Wikis/ZODB/&lt;/a&gt;&lt;br&gt;&lt;br&gt;ZODB-Dev mailing list &amp;nbsp;- &amp;nbsp;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26830478&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ZODB-Dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.zope.org/mailman/listinfo/zodb-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.zope.org/mailman/listinfo/zodb-dev&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Python-properties-on-Persistent-objects-tp26820966p26830478.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26827240</id>
	<title>Re: Python properties on Persistent objects</title>
	<published>2009-12-17T04:21:40Z</published>
	<updated>2009-12-17T04:21:40Z</updated>
	<author>
		<name>Jim Fulton</name>
	</author>
	<content type="html">On Wed, Dec 16, 2009 at 7:12 PM, Mikko Ohtamaa &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26827240&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;mikko@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; I need to have little clarification should properties work on
&lt;br&gt;&amp;gt; Persistent objects.
&lt;br&gt;&lt;br&gt;Properties work with persistent objects with one limitation that I'm aware of.
&lt;br&gt;The __setattribute__ method used by the persistent base class assumes
&lt;br&gt;that any attribute assignment modifies the object's persistent state.
&lt;br&gt;A property
&lt;br&gt;that doesn't modify state or that modifies volatile state will fool
&lt;br&gt;it. Conceivably,
&lt;br&gt;one could override __setattribute__ to handle such properties, but doing so
&lt;br&gt;would require great care. I don't recommend it.
&lt;br&gt;&lt;br&gt;Jim
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Jim Fulton
&lt;br&gt;_______________________________________________
&lt;br&gt;For more information about ZODB, see the ZODB Wiki:
&lt;br&gt;&lt;a href=&quot;http://www.zope.org/Wikis/ZODB/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.zope.org/Wikis/ZODB/&lt;/a&gt;&lt;br&gt;&lt;br&gt;ZODB-Dev mailing list &amp;nbsp;- &amp;nbsp;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26827240&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ZODB-Dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.zope.org/mailman/listinfo/zodb-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.zope.org/mailman/listinfo/zodb-dev&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Python-properties-on-Persistent-objects-tp26820966p26827240.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26826466</id>
	<title>Re: Python properties on Persistent objects</title>
	<published>2009-12-17T03:10:50Z</published>
	<updated>2009-12-17T03:10:50Z</updated>
	<author>
		<name>Mikko Ohtamaa</name>
	</author>
	<content type="html">&amp;gt; That code is insane. Really insane. It's generating classes and doing
&lt;br&gt;&amp;gt; custom adapter factories that inject a _v_ variable into a persistent
&lt;br&gt;&amp;gt; object temporarily. I wouldn't try to copy it at all. I would run away.
&lt;br&gt;&lt;br&gt;But I thought this was *the* Zope way and the brightest minds in the
&lt;br&gt;community have obviously written the code :)
&lt;br&gt;&lt;br&gt;In any case, the persistent + property issue has received some
&lt;br&gt;awareness until it bits someone's ass again. I am going back to the
&lt;br&gt;drawing board and my behaviors.
&lt;br&gt;&lt;br&gt;property set = always starts transaction even though nothing is being written
&lt;br&gt;&lt;br&gt;-Mikko
&lt;br&gt;_______________________________________________
&lt;br&gt;For more information about ZODB, see the ZODB Wiki:
&lt;br&gt;&lt;a href=&quot;http://www.zope.org/Wikis/ZODB/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.zope.org/Wikis/ZODB/&lt;/a&gt;&lt;br&gt;&lt;br&gt;ZODB-Dev mailing list &amp;nbsp;- &amp;nbsp;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26826466&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ZODB-Dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.zope.org/mailman/listinfo/zodb-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.zope.org/mailman/listinfo/zodb-dev&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Python-properties-on-Persistent-objects-tp26820966p26826466.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26825228</id>
	<title>Re: Python properties on Persistent objects</title>
	<published>2009-12-17T01:18:57Z</published>
	<updated>2009-12-17T01:18:57Z</updated>
	<author>
		<name>Martin Aspeli-3</name>
	</author>
	<content type="html">Mikko Ohtamaa wrote:
&lt;br&gt;&amp;gt;&amp;gt; This isn't right: a z3c.form form is just a view like any other. It is
&lt;br&gt;&amp;gt;&amp;gt; looked up on the context and the request. In Dexterity (which I assume
&lt;br&gt;&amp;gt;&amp;gt; you're using?), that's going to be the content object.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Sorry, I think I mixed with zope.formlib. In any case I hope to find
&lt;br&gt;&amp;gt; the answer to the orignal question.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; The original pattern which I copied is is here:
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://code.google.com/p/getpaid/source/browse/Products.PloneGetPaid/trunk/Products/PloneGetPaid/preferences.py&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://code.google.com/p/getpaid/source/browse/Products.PloneGetPaid/trunk/Products/PloneGetPaid/preferences.py&lt;/a&gt;&lt;br&gt;&lt;br&gt;That code is insane. Really insane. It's generating classes and doing 
&lt;br&gt;custom adapter factories that inject a _v_ variable into a persistent 
&lt;br&gt;object temporarily. I wouldn't try to copy it at all. I would run away.
&lt;br&gt;&lt;br&gt;I *think* what may be happening here is that most of the vocabularies in 
&lt;br&gt;plone.app.vocabularies have code like this:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; context = getattr(context, 'context', context)
&lt;br&gt;&lt;br&gt;This hack is there to support the IAdding view use case where the 
&lt;br&gt;context of the add form is another view and the first &amp;quot;real&amp;quot; content 
&lt;br&gt;object from which you can acquire stuff is self.context.context. We're 
&lt;br&gt;moving away from that in favour of not acquiring tools and not using 
&lt;br&gt;views-on-views, which are evil anyway. Hence, the 'context' property in 
&lt;br&gt;StoreSettings, which I presume is used as the context for a form, is 
&lt;br&gt;being cajoled into being the Plone site root. But that's using a hack to 
&lt;br&gt;trick a hack into doing different hackery.
&lt;br&gt;&lt;br&gt;This is getting far off topic for the ZODB list, but if you can explain 
&lt;br&gt;what problem you're actually trying to solve, I'm sure we can come up 
&lt;br&gt;with a suggestion that is less of an architecture spacewalk.
&lt;br&gt;&lt;br&gt;When you start having to ask the ZODB list, maybe it's time to think 
&lt;br&gt;whether you could find a simpler solution. :-)
&lt;br&gt;&lt;br&gt;&amp;gt; I don't think I am doing it incorrectly. The other reason of using
&lt;br&gt;&amp;gt; this pattern is that the behavior factory does not need to have a
&lt;br&gt;&amp;gt; write or (an extra) object load if the behavior is never set on the
&lt;br&gt;&amp;gt; context object. The default object returned by factory acts similar
&lt;br&gt;&amp;gt; than the persistent object and I can set the behavior defaults using
&lt;br&gt;&amp;gt; zope.schema - I don't need to do &amp;quot;if not set&amp;quot; logic anywhere else in
&lt;br&gt;&amp;gt; my code.
&lt;br&gt;&lt;br&gt;There is no reason you can't get this &amp;quot;don't-write-unless-necessary&amp;quot; 
&lt;br&gt;behaviour in a much more sane way. In fact, it ought to be the default. 
&lt;br&gt;To help you, I'd need a more comprehensive understanding of what you're 
&lt;br&gt;doing and why, though.
&lt;br&gt;&lt;br&gt;Martin
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Author of `Professional Plone Development`, a book for developers who
&lt;br&gt;want to work with Plone. See &lt;a href=&quot;http://martinaspeli.net/plone-book&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://martinaspeli.net/plone-book&lt;/a&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;For more information about ZODB, see the ZODB Wiki:
&lt;br&gt;&lt;a href=&quot;http://www.zope.org/Wikis/ZODB/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.zope.org/Wikis/ZODB/&lt;/a&gt;&lt;br&gt;&lt;br&gt;ZODB-Dev mailing list &amp;nbsp;- &amp;nbsp;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26825228&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ZODB-Dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.zope.org/mailman/listinfo/zodb-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.zope.org/mailman/listinfo/zodb-dev&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Python-properties-on-Persistent-objects-tp26820966p26825228.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26824879</id>
	<title>Re: Python properties on Persistent objects</title>
	<published>2009-12-17T00:43:18Z</published>
	<updated>2009-12-17T00:43:18Z</updated>
	<author>
		<name>Mikko Ohtamaa</name>
	</author>
	<content type="html">&amp;gt;
&lt;br&gt;&amp;gt; This isn't right: a z3c.form form is just a view like any other. It is
&lt;br&gt;&amp;gt; looked up on the context and the request. In Dexterity (which I assume
&lt;br&gt;&amp;gt; you're using?), that's going to be the content object.
&lt;br&gt;&lt;br&gt;Sorry, I think I mixed with zope.formlib. In any case I hope to find
&lt;br&gt;the answer to the orignal question.
&lt;br&gt;&lt;br&gt;The original pattern which I copied is is here:
&lt;br&gt;&lt;a href=&quot;http://code.google.com/p/getpaid/source/browse/Products.PloneGetPaid/trunk/Products/PloneGetPaid/preferences.py&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://code.google.com/p/getpaid/source/browse/Products.PloneGetPaid/trunk/Products/PloneGetPaid/preferences.py&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I think you need to take a step back and look at how your form is set
&lt;br&gt;&amp;gt; up, not dive into deep magic of persistence.
&lt;br&gt;&lt;br&gt;I don't think I am doing it incorrectly. The other reason of using
&lt;br&gt;this pattern is that the behavior factory does not need to have a
&lt;br&gt;write or (an extra) object load if the behavior is never set on the
&lt;br&gt;context object. The default object returned by factory acts similar
&lt;br&gt;than the persistent object and I can set the behavior defaults using
&lt;br&gt;zope.schema - I don't need to do &amp;quot;if not set&amp;quot; logic anywhere else in
&lt;br&gt;my code.
&lt;br&gt;&lt;br&gt;=)
&lt;br&gt;&lt;br&gt;Cheers,
&lt;br&gt;-Mikko
&lt;br&gt;_______________________________________________
&lt;br&gt;For more information about ZODB, see the ZODB Wiki:
&lt;br&gt;&lt;a href=&quot;http://www.zope.org/Wikis/ZODB/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.zope.org/Wikis/ZODB/&lt;/a&gt;&lt;br&gt;&lt;br&gt;ZODB-Dev mailing list &amp;nbsp;- &amp;nbsp;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26824879&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ZODB-Dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.zope.org/mailman/listinfo/zodb-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.zope.org/mailman/listinfo/zodb-dev&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Python-properties-on-Persistent-objects-tp26820966p26824879.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26821312</id>
	<title>Re: Python properties on Persistent objects</title>
	<published>2009-12-16T16:49:40Z</published>
	<updated>2009-12-16T16:49:40Z</updated>
	<author>
		<name>Martin Aspeli-3</name>
	</author>
	<content type="html">Laurence Rowe wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; 2009/12/17 Mikko Ohtamaa&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26821312&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;mikko@...&lt;/a&gt;&amp;gt;:
&lt;br&gt;&amp;gt;&amp;gt; Hi,
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; I need to have little clarification should properties work on
&lt;br&gt;&amp;gt;&amp;gt; Persistent objects. I am running ZODB 3.8.4 on Plone 3.3.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; I am using plone.behavior and adapters to retrofit objects with a new
&lt;br&gt;&amp;gt;&amp;gt; behavior (HeaderBehavior object). This object is also editable through
&lt;br&gt;&amp;gt;&amp;gt; z3c.form interface. z3c.form requires a context variable on the object
&lt;br&gt;&amp;gt;&amp;gt; e.g. to look up dynamic vocabularies. To avoid having this
&lt;br&gt;&amp;gt;&amp;gt; object.context attribute to be peristent (as it's known every time by
&lt;br&gt;&amp;gt;&amp;gt; the factory method of the adapter which creates/look-ups
&lt;br&gt;&amp;gt;&amp;gt; HeaderBehavior) I tried to spoof context variable using properties and
&lt;br&gt;&amp;gt;&amp;gt; internal volatile variable. This was a trick I learnt somewhere
&lt;br&gt;&amp;gt;&amp;gt; (getpaid.core?)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; This sounds like you are passing context somewhere where view is expected.
&lt;/div&gt;&lt;br&gt;Yeah, to me as well it sounds like you're barking up the wrong tree 
&lt;br&gt;here. You shouldn't need any kind of faking like this.
&lt;br&gt;&lt;br&gt;&amp;quot;z3c.form requires a context variable on the object
&lt;br&gt;e.g. to look up dynamic vocabularies&amp;quot;
&lt;br&gt;&lt;br&gt;This isn't right: a z3c.form form is just a view like any other. It is 
&lt;br&gt;looked up on the context and the request. In Dexterity (which I assume 
&lt;br&gt;you're using?), that's going to be the content object.
&lt;br&gt;&lt;br&gt;I think you need to take a step back and look at how your form is set 
&lt;br&gt;up, not dive into deep magic of persistence.
&lt;br&gt;&lt;br&gt;Martin
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Author of `Professional Plone Development`, a book for developers who
&lt;br&gt;want to work with Plone. See &lt;a href=&quot;http://martinaspeli.net/plone-book&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://martinaspeli.net/plone-book&lt;/a&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;For more information about ZODB, see the ZODB Wiki:
&lt;br&gt;&lt;a href=&quot;http://www.zope.org/Wikis/ZODB/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.zope.org/Wikis/ZODB/&lt;/a&gt;&lt;br&gt;&lt;br&gt;ZODB-Dev mailing list &amp;nbsp;- &amp;nbsp;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26821312&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ZODB-Dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.zope.org/mailman/listinfo/zodb-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.zope.org/mailman/listinfo/zodb-dev&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Python-properties-on-Persistent-objects-tp26820966p26821312.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26821093</id>
	<title>Re: Python properties on Persistent objects</title>
	<published>2009-12-16T16:24:05Z</published>
	<updated>2009-12-16T16:24:05Z</updated>
	<author>
		<name>Laurence Rowe</name>
	</author>
	<content type="html">2009/12/17 Mikko Ohtamaa &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26821093&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;mikko@...&lt;/a&gt;&amp;gt;:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hi,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I need to have little clarification should properties work on
&lt;br&gt;&amp;gt; Persistent objects. I am running ZODB 3.8.4 on Plone 3.3.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I am using plone.behavior and adapters to retrofit objects with a new
&lt;br&gt;&amp;gt; behavior (HeaderBehavior object). This object is also editable through
&lt;br&gt;&amp;gt; z3c.form interface. z3c.form requires a context variable on the object
&lt;br&gt;&amp;gt; e.g. to look up dynamic vocabularies. To avoid having this
&lt;br&gt;&amp;gt; object.context attribute to be peristent (as it's known every time by
&lt;br&gt;&amp;gt; the factory method of the adapter which creates/look-ups
&lt;br&gt;&amp;gt; HeaderBehavior) I tried to spoof context variable using properties and
&lt;br&gt;&amp;gt; internal volatile variable. This was a trick I learnt somewhere
&lt;br&gt;&amp;gt; (getpaid.core?)
&lt;/div&gt;&lt;br&gt;This sounds like you are passing context somewhere where view is expected.
&lt;br&gt;&lt;br&gt;Laurence
&lt;br&gt;_______________________________________________
&lt;br&gt;For more information about ZODB, see the ZODB Wiki:
&lt;br&gt;&lt;a href=&quot;http://www.zope.org/Wikis/ZODB/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.zope.org/Wikis/ZODB/&lt;/a&gt;&lt;br&gt;&lt;br&gt;ZODB-Dev mailing list &amp;nbsp;- &amp;nbsp;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26821093&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ZODB-Dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.zope.org/mailman/listinfo/zodb-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.zope.org/mailman/listinfo/zodb-dev&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Python-properties-on-Persistent-objects-tp26820966p26821093.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26820966</id>
	<title>Python properties on Persistent objects</title>
	<published>2009-12-16T16:12:00Z</published>
	<updated>2009-12-16T16:12:00Z</updated>
	<author>
		<name>Mikko Ohtamaa</name>
	</author>
	<content type="html">Hi,
&lt;br&gt;&lt;br&gt;I need to have little clarification should properties work on
&lt;br&gt;Persistent objects. I am running ZODB 3.8.4 on Plone 3.3.
&lt;br&gt;&lt;br&gt;I am using plone.behavior and adapters to retrofit objects with a new
&lt;br&gt;behavior (HeaderBehavior object). This object is also editable through
&lt;br&gt;z3c.form interface. z3c.form requires a context variable on the object
&lt;br&gt;e.g. to look up dynamic vocabularies. To avoid having this
&lt;br&gt;object.context attribute to be peristent (as it's known every time by
&lt;br&gt;the factory method of the adapter which creates/look-ups
&lt;br&gt;HeaderBehavior) I tried to spoof context variable using properties and
&lt;br&gt;internal volatile variable. This was a trick I learnt somewhere
&lt;br&gt;(getpaid.core?)
&lt;br&gt;&lt;br&gt;It didn't work. Looks like Persistent class is not aware of properties
&lt;br&gt;and interprets property set as a transaction start. So even though I
&lt;br&gt;thought I was having a volatile context, my Undo log kept having new
&lt;br&gt;write entries on every page read for pages having HeaderBehavior
&lt;br&gt;objects in their annotations. Data.fs grew steadily with small writes
&lt;br&gt;and there was a whole bunch of ConflictErrors.
&lt;br&gt;&lt;br&gt;I think I found a workaround. By overriding __setattr__ and not
&lt;br&gt;letting through properties and volatile attribute set to Persistent
&lt;br&gt;__setattr__ you can avoid the problem.
&lt;br&gt;&lt;br&gt;Is my rationale correct? Should Persistent behave well with
&lt;br&gt;properties? I found only one discussion in Google, circa 2004.
&lt;br&gt;&lt;br&gt;Sample code below:
&lt;br&gt;&lt;br&gt;from persistent import Persistent
&lt;br&gt;class VolatileContext(Persistent):
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;quot;&amp;quot;&amp;quot; Mix-in class to provide non-persistent context attribute to
&lt;br&gt;persistent classes.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; Some subsystems (e.g. z3c.forms) expect objects to have a context
&lt;br&gt;reference to parent/site/whatever.
&lt;br&gt;&amp;nbsp; &amp;nbsp; However, storing this back-reference persistenly is not needed, as
&lt;br&gt;the factory
&lt;br&gt;&amp;nbsp; &amp;nbsp; method will always know the context.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; This helper class creates a context property which is volatile
&lt;br&gt;(never persistent),
&lt;br&gt;&amp;nbsp; &amp;nbsp; but can be still set on the object after creation or after database load.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;quot;&amp;quot;&amp;quot;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; zope.interface.implements(IVolatileContext)
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; def _set_context(self, context):
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self._v_context = context
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; def _get_context(self):
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return self._v_context
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; def _set_factory(self, factory):
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self._v_factory = factory
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; def _get_factory(self):
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return self._v_factory
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; # &lt;a href=&quot;http://docs.python.org/library/functions.html#property&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://docs.python.org/library/functions.html#property&lt;/a&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; context = property(_get_context, _set_context)
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; factory = property(_get_factory, _set_factory)
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; def save(self):
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;quot;&amp;quot;&amp;quot; &amp;quot;&amp;quot;&amp;quot;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.factory.makePersistent(self)
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; def __setattr__(self, name, value):
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if name not in (&amp;quot;context&amp;quot;, &amp;quot;factory&amp;quot;, &amp;quot;_v_context&amp;quot;, &amp;quot;_v_factory&amp;quot;):
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Persistent.__setattr__(self, name, value)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print &amp;quot;leaking &amp;quot; + name + &amp;quot; &amp;quot; + str(value)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print &amp;quot;property set &amp;quot; + name + &amp;quot; &amp;quot; + str(value)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; object.__setattr__(self, name, value)
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;class AnnotationPersistentFactory(object):
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;quot;&amp;quot;&amp;quot; A factory pattern to manufacture persistent objects stored
&lt;br&gt;within the parent object annotations.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; Until the first write, the default (non-persistent) object is
&lt;br&gt;return. This prevents
&lt;br&gt;&amp;nbsp; &amp;nbsp; possible situations where database read could cause write.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; The first write must call
&lt;br&gt;AnnotationPersistentFactory.makePersistent(object).
&lt;br&gt;&amp;nbsp; &amp;nbsp; Alternative, you can call AnnotationPersistentFactory.makePersistent(object)
&lt;br&gt;&amp;nbsp; &amp;nbsp; when entering the editing interface for the first time.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; After the first write, the saved persistent object is return.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;quot;&amp;quot;&amp;quot;
&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; def __init__(self, persistent_class, key):
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;quot;&amp;quot;&amp;quot;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; @param persistent_class: Class reference / factory method
&lt;br&gt;which will create new objects.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Created classes must conform VolatileContext interface
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; @param key: ASCII string, Key name used with IAnnotations
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;quot;&amp;quot;&amp;quot;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.persistent_class = persistent_class
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.key = key
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self._assertProperlySetUp()
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; def _assertProperlySetUp(self):
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;quot;&amp;quot;&amp;quot;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Check that the framework is properly set up
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;quot;&amp;quot;&amp;quot;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; assert callable(self.persistent_class), &amp;quot;Factory is missing&amp;quot;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; assert hasattr(self.persistent_class, &amp;quot;context&amp;quot;), &amp;quot;The
&lt;br&gt;persistent object must support volatile context interface&amp;quot;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; assert self.key is not None, &amp;quot;You must give the annotations key&amp;quot;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; def makePersistent(self, object):
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;quot;&amp;quot;&amp;quot; Write created persistent object to the database.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; This will store the object on the annotations of its context.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;quot;&amp;quot;&amp;quot;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; assert isinstance(object, self.persistent_class), &amp;quot;Object %s
&lt;br&gt;was not type of %s&amp;quot; % (str(object), str(self.persistent_class))
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; annotations = IAnnotations(object.context)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; annotations[self.key] = object
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; def __call__(self, context):
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;quot;&amp;quot;&amp;quot; Called by Zope framework when doing a factory call.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Usually this class is refered as &amp;lt;adapter factory=&amp;quot;&amp;quot;&amp;gt; and
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; this method creates a new, read-only, persistent object.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;quot;&amp;quot;&amp;quot;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; annotations = IAnnotations(context)
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if not self.key in annotations:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Construct a new (default) instance
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print &amp;quot;Created&amp;quot;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; object = self.persistent_class()
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Return the object stored previously
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print &amp;quot;Found&amp;quot;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; object = annotations[self.key]
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Set volatile context reference
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; object.context = context
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; object.factory = self
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return object
&lt;br&gt;&lt;br&gt;-Mikko
&lt;br&gt;_______________________________________________
&lt;br&gt;For more information about ZODB, see the ZODB Wiki:
&lt;br&gt;&lt;a href=&quot;http://www.zope.org/Wikis/ZODB/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.zope.org/Wikis/ZODB/&lt;/a&gt;&lt;br&gt;&lt;br&gt;ZODB-Dev mailing list &amp;nbsp;- &amp;nbsp;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26820966&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ZODB-Dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.zope.org/mailman/listinfo/zodb-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.zope.org/mailman/listinfo/zodb-dev&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Python-properties-on-Persistent-objects-tp26820966p26820966.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26815394</id>
	<title>ZODB 3.8.5 released</title>
	<published>2009-12-16T09:46:29Z</published>
	<updated>2009-12-16T09:46:29Z</updated>
	<author>
		<name>Jim Fulton</name>
	</author>
	<content type="html">I've released 3.8.5, which has one important bug fix and some minor
&lt;br&gt;forward-compatibility changes we discussed here recently.
&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://pypi.python.org/pypi/ZODB3/3.8.5&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://pypi.python.org/pypi/ZODB3/3.8.5&lt;/a&gt;&lt;br&gt;&lt;br&gt;Jim
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Jim Fulton
&lt;br&gt;_______________________________________________
&lt;br&gt;For more information about ZODB, see the ZODB Wiki:
&lt;br&gt;&lt;a href=&quot;http://www.zope.org/Wikis/ZODB/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.zope.org/Wikis/ZODB/&lt;/a&gt;&lt;br&gt;&lt;br&gt;ZODB-Dev mailing list &amp;nbsp;- &amp;nbsp;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26815394&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ZODB-Dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.zope.org/mailman/listinfo/zodb-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.zope.org/mailman/listinfo/zodb-dev&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/ZODB-3.8.5-released-tp26815394p26815394.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26798106</id>
	<title>Re: zc.demostorage2 assumes too much?</title>
	<published>2009-12-15T09:02:13Z</published>
	<updated>2009-12-15T09:02:13Z</updated>
	<author>
		<name>Jim Fulton</name>
	</author>
	<content type="html">On Thu, Nov 26, 2009 at 7:33 AM, Wolfgang Schnerring &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26798106&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ws@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hello,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; zc.demostorage2 assumes that the tpc_begin() of its underlying
&lt;br&gt;&amp;gt; storages takes three parameters (transaction, tid, status), while both
&lt;br&gt;&amp;gt; MappingStorage and IStorage only know about the first two.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; This strikes me as risky, and it does indeed break, for example when
&lt;br&gt;&amp;gt; trying to use a DemoStorage as the 'changes' backend of a
&lt;br&gt;&amp;gt; DemoStorage2.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I've tried and removed the status parameter from zc.demostorage2 and
&lt;br&gt;&amp;gt; its tests still pass, but I must confess I have no clue what this
&lt;br&gt;&amp;gt; status parameter actually does, so I don't really know what (if
&lt;br&gt;&amp;gt; anything) to do about this issue.
&lt;/div&gt;&lt;br&gt;The tid and status parameters are used when copying already committed
&lt;br&gt;transactions. &amp;nbsp;zc.demostprage2 should check whether tid is None
&lt;br&gt;and only pass tid and status when it isn't.
&lt;br&gt;&lt;br&gt;Jim
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Jim Fulton
&lt;br&gt;_______________________________________________
&lt;br&gt;For more information about ZODB, see the ZODB Wiki:
&lt;br&gt;&lt;a href=&quot;http://www.zope.org/Wikis/ZODB/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.zope.org/Wikis/ZODB/&lt;/a&gt;&lt;br&gt;&lt;br&gt;ZODB-Dev mailing list &amp;nbsp;- &amp;nbsp;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26798106&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ZODB-Dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.zope.org/mailman/listinfo/zodb-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.zope.org/mailman/listinfo/zodb-dev&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/zc.demostorage2-assumes-too-much--tp26528798p26798106.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26786578</id>
	<title>ZODB 3.9.4 released</title>
	<published>2009-12-14T15:03:35Z</published>
	<updated>2009-12-14T15:03:35Z</updated>
	<author>
		<name>Jim Fulton</name>
	</author>
	<content type="html">&lt;a href=&quot;http://pypi.python.org/pypi/ZODB3/3.9.4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://pypi.python.org/pypi/ZODB3/3.9.4&lt;/a&gt;&lt;br&gt;&lt;br&gt;Bugs Fixed
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; * A ZEO threading bug could cause transactions to read
&lt;br&gt;inconsistent data. (This sometimes caused an AssertionError in
&lt;br&gt;Connection._setstate_noncurrent.)
&lt;br&gt;&amp;nbsp; &amp;nbsp; * DemoStorage.loadBefore sometimes returned invalid data which
&lt;br&gt;would trigger AssertionErrors in ZODB.Connection.
&lt;br&gt;&amp;nbsp; &amp;nbsp; * History support was broken when using stprages that work with
&lt;br&gt;ZODB 3.8 and 3.9.
&lt;br&gt;&amp;nbsp; &amp;nbsp; * zope.testing was an unnecessary non-testing dependency.
&lt;br&gt;&amp;nbsp; &amp;nbsp; * Internal ZEO errors were logged at the INFO level, rather than
&lt;br&gt;at the error level.
&lt;br&gt;&amp;nbsp; &amp;nbsp; * The FileStorage backup and restore script, repozo, gave a
&lt;br&gt;deprecation warning under Python 2.6.
&lt;br&gt;&amp;nbsp; &amp;nbsp; * C Header files weren't installed correctly.
&lt;br&gt;&amp;nbsp; &amp;nbsp; * The repozo backup utility gave deprecation warnings when run.
&lt;br&gt;&lt;br&gt;Jim
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Jim Fulton
&lt;br&gt;_______________________________________________
&lt;br&gt;For more information about ZODB, see the ZODB Wiki:
&lt;br&gt;&lt;a href=&quot;http://www.zope.org/Wikis/ZODB/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.zope.org/Wikis/ZODB/&lt;/a&gt;&lt;br&gt;&lt;br&gt;ZODB-Dev mailing list &amp;nbsp;- &amp;nbsp;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26786578&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ZODB-Dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.zope.org/mailman/listinfo/zodb-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.zope.org/mailman/listinfo/zodb-dev&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/ZODB-3.9.4-released-tp26786578p26786578.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26785536</id>
	<title>Re: BTrees and id mapping (was Re: Data.fs size grows non-stop)</title>
	<published>2009-12-14T13:49:23Z</published>
	<updated>2009-12-14T13:49:23Z</updated>
	<author>
		<name>Tres Seaver</name>
	</author>
	<content type="html">-----BEGIN PGP SIGNED MESSAGE-----
&lt;br&gt;Hash: SHA1
&lt;br&gt;&lt;br&gt;Pedro Ferreira wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; David Glick wrote:
&lt;br&gt;&amp;gt;&amp;gt; Pedro Ferreira wrote:
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Hello all,
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; So, I've been experimenting with a new structure for our date indexes, 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; and I was considering using an IOBTree that would map integer timestamps 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; to BTree-based sets. As for the sets, I considered two options:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;gt;&amp;gt; Be careful with using timestamps as IOBTree keys. &amp;nbsp;By default this type 
&lt;br&gt;&amp;gt;&amp;gt; of BTree uses the system integer, which on many systems is 32 bits. &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; That means that you'll overflow the maximum allowed key for timestamps 
&lt;br&gt;&amp;gt;&amp;gt; beyond the year 2038. &amp;nbsp;It won't even give an error; it will just 
&lt;br&gt;&amp;gt;&amp;gt; silently overflow and overwrite existing values in the BTree.
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; 
&lt;br&gt;&amp;gt; Yes, I know. That's one of the reasons I'm using YYYYmmdd integers 
&lt;br&gt;&amp;gt; instead (the other one being i only need 1 day resolution).
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Thanks a lot for the tip!
&lt;/div&gt;&lt;br&gt;An LOBTree uses a guaranteed-to-be-long (64 bits) integer for the keys,
&lt;br&gt;if you need that.
&lt;br&gt;&lt;br&gt;&lt;br&gt;Tres.
&lt;br&gt;- --
&lt;br&gt;===================================================================
&lt;br&gt;Tres Seaver &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;+1 540-429-0999 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26785536&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;tseaver@...&lt;/a&gt;
&lt;br&gt;Palladion Software &amp;nbsp; &amp;quot;Excellence by Design&amp;quot; &amp;nbsp; &amp;nbsp;&lt;a href=&quot;http://palladion.com&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://palladion.com&lt;/a&gt;&lt;br&gt;-----BEGIN PGP SIGNATURE-----
&lt;br&gt;Version: GnuPG v1.4.9 (GNU/Linux)
&lt;br&gt;Comment: Using GnuPG with Mozilla - &lt;a href=&quot;http://enigmail.mozdev.org&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://enigmail.mozdev.org&lt;/a&gt;&lt;br&gt;&lt;br&gt;iEYEARECAAYFAksmsuMACgkQ+gerLs4ltQ6mNgCgwBpVRaUli7a7Ij1NQYYHsxif
&lt;br&gt;OD0AnjgAGY1TB6GAadx1qSmwW/8w5c1a
&lt;br&gt;=ZJRe
&lt;br&gt;-----END PGP SIGNATURE-----
&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;For more information about ZODB, see the ZODB Wiki:
&lt;br&gt;&lt;a href=&quot;http://www.zope.org/Wikis/ZODB/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.zope.org/Wikis/ZODB/&lt;/a&gt;&lt;br&gt;&lt;br&gt;ZODB-Dev mailing list &amp;nbsp;- &amp;nbsp;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26785536&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ZODB-Dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.zope.org/mailman/listinfo/zodb-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.zope.org/mailman/listinfo/zodb-dev&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/cache-size-bytes-usable--tp26246822p26785536.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26775613</id>
	<title>Re: BTrees and id mapping (was Re: Data.fs size grows non-stop)</title>
	<published>2009-12-14T02:17:10Z</published>
	<updated>2009-12-14T02:17:10Z</updated>
	<author>
		<name>Pedro Ferreira-7</name>
	</author>
	<content type="html">David Glick wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Pedro Ferreira wrote:
&lt;br&gt;&amp;gt; &amp;nbsp; 
&lt;br&gt;&amp;gt;&amp;gt; Hello all,
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; So, I've been experimenting with a new structure for our date indexes, 
&lt;br&gt;&amp;gt;&amp;gt; and I was considering using an IOBTree that would map integer timestamps 
&lt;br&gt;&amp;gt;&amp;gt; to BTree-based sets. As for the sets, I considered two options:
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; 
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;gt; Be careful with using timestamps as IOBTree keys. &amp;nbsp;By default this type 
&lt;br&gt;&amp;gt; of BTree uses the system integer, which on many systems is 32 bits. &amp;nbsp;
&lt;br&gt;&amp;gt; That means that you'll overflow the maximum allowed key for timestamps 
&lt;br&gt;&amp;gt; beyond the year 2038. &amp;nbsp;It won't even give an error; it will just 
&lt;br&gt;&amp;gt; silently overflow and overwrite existing values in the BTree.
&lt;br&gt;&amp;gt; &amp;nbsp; 
&lt;/div&gt;Yes, I know. That's one of the reasons I'm using YYYYmmdd integers 
&lt;br&gt;instead (the other one being i only need 1 day resolution).
&lt;br&gt;&lt;br&gt;Thanks a lot for the tip!
&lt;br&gt;&lt;br&gt;Pedro
&lt;br&gt;_______________________________________________
&lt;br&gt;For more information about ZODB, see the ZODB Wiki:
&lt;br&gt;&lt;a href=&quot;http://www.zope.org/Wikis/ZODB/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.zope.org/Wikis/ZODB/&lt;/a&gt;&lt;br&gt;&lt;br&gt;ZODB-Dev mailing list &amp;nbsp;- &amp;nbsp;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26775613&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ZODB-Dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.zope.org/mailman/listinfo/zodb-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.zope.org/mailman/listinfo/zodb-dev&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/cache-size-bytes-usable--tp26246822p26775613.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26742412</id>
	<title>BTrees and id mapping (was Re: Data.fs size grows non-stop)</title>
	<published>2009-12-11T03:09:10Z</published>
	<updated>2009-12-11T03:09:10Z</updated>
	<author>
		<name>Pedro Ferreira-7</name>
	</author>
	<content type="html">Hello all,
&lt;br&gt;&lt;br&gt;So, I've been experimenting with a new structure for our date indexes, 
&lt;br&gt;and I was considering using an IOBTree that would map integer timestamps 
&lt;br&gt;to BTree-based sets. As for the sets, I considered two options:
&lt;br&gt;&lt;br&gt;&amp;nbsp;1. An IITreeSet based on the OID and an additional IOBTree that maps 
&lt;br&gt;back the OIDs to objects;
&lt;br&gt;&amp;nbsp;2. An OOTreeSet;
&lt;br&gt;&lt;br&gt;As expected 1 was light years faster when I tried to query for large 
&lt;br&gt;timespans (doing normal union operations using OOTreeSets seems to be a 
&lt;br&gt;very slow operation). Still, for single days (and generally timespans 
&lt;br&gt;smaller than 7 days), the OOTreeSet seems to be much faster (apparently, 
&lt;br&gt;iterating through the all the ids in the resulting set and fetching the 
&lt;br&gt;corresponding object takes some time, even for sets with only one 
&lt;br&gt;member, so, IITreeSet seems to be in disadvantage here).
&lt;br&gt;Does anyone have any advice on optimizing the first case? I believe the 
&lt;br&gt;IITreeSet is the way to go, but if only there was some way to make the 
&lt;br&gt;int&amp;lt;-&amp;gt;object conversion operation less expensive...
&lt;br&gt;&lt;br&gt;Thanks in advance,
&lt;br&gt;&lt;br&gt;Pedro
&lt;br&gt;_______________________________________________
&lt;br&gt;For more information about ZODB, see the ZODB Wiki:
&lt;br&gt;&lt;a href=&quot;http://www.zope.org/Wikis/ZODB/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.zope.org/Wikis/ZODB/&lt;/a&gt;&lt;br&gt;&lt;br&gt;ZODB-Dev mailing list &amp;nbsp;- &amp;nbsp;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26742412&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ZODB-Dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.zope.org/mailman/listinfo/zodb-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.zope.org/mailman/listinfo/zodb-dev&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/cache-size-bytes-usable--tp26246822p26742412.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26737249</id>
	<title>Re: ZODB 3.9/3.8 incompatibility (was Re: Data.fs size grows non-stop)</title>
	<published>2009-12-10T17:12:21Z</published>
	<updated>2009-12-10T17:12:21Z</updated>
	<author>
		<name>Marius Gedminas-4</name>
	</author>
	<content type="html">On Thu, Dec 10, 2009 at 02:07:06PM -0500, Jim Fulton wrote:
&lt;div class='shrinkable-quote'&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Thu, Dec 10, 2009 at 1:50 PM, Marius Gedminas &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26737249&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;marius@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; &amp;gt; On Thu, Dec 10, 2009 at 12:41:11PM -0500, Jim Fulton wrote:
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; On Thu, Dec 10, 2009 at 11:54 AM, Marius Gedminas &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26737249&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;marius@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; In 3.9 for FileStorage, if you give a starting tid that is toward the
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; end of the file,
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; it will scan backward, saving a lot of time.
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Ah, but how can I get a valid tid that is toward the end of the file?
&lt;br&gt;&amp;gt; &amp;gt; I assume that if I give a tid that doesn't exist, I'll get an error --
&lt;br&gt;&amp;gt; &amp;gt; which is the behavior oldstate() exhibits -- rather than the next
&lt;br&gt;&amp;gt; &amp;gt; existing transaction after that timestamp, or I could fudge by getting
&lt;br&gt;&amp;gt; &amp;gt; the current timestamp and subtracting 24 hours.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; No, the iterator starts at the first transactions who's tid is &amp;gt;= the
&lt;br&gt;&amp;gt; start tid.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; So, guess a time and use repr(ZODB.TimeStamp.TimeStamp(...))
&lt;/div&gt;&lt;/div&gt;Cool! &amp;nbsp;Thank you,
&lt;br&gt;&lt;br&gt;Marius Gedminas
&lt;br&gt;-- 
&lt;br&gt;This message has been ROT-13 encrypted twice for higher security.
&lt;br&gt;&lt;br /&gt; &lt;br /&gt;_______________________________________________
&lt;br&gt;For more information about ZODB, see the ZODB Wiki:
&lt;br&gt;&lt;a href=&quot;http://www.zope.org/Wikis/ZODB/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.zope.org/Wikis/ZODB/&lt;/a&gt;&lt;br&gt;&lt;br&gt;ZODB-Dev mailing list &amp;nbsp;- &amp;nbsp;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26737249&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ZODB-Dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.zope.org/mailman/listinfo/zodb-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.zope.org/mailman/listinfo/zodb-dev&lt;/a&gt;&lt;br&gt;&lt;div class=&quot;small&quot;&gt;&lt;br/&gt;&lt;img src=&quot;http://old.nabble.com/images/icon_attachment.gif&quot; &gt; &lt;strong&gt;signature.asc&lt;/strong&gt; (196 bytes) &lt;a href=&quot;http://old.nabble.com/attachment/26737249/0/signature.asc&quot; target=&quot;_top&quot;&gt;Download Attachment&lt;/a&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/ZODB-3.9-3.8-incompatibility-%28was-Re%3A-Data.fs-size-grows-non-stop%29-tp26714772p26737249.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26732788</id>
	<title>Re: ZODB 3.9/3.8 incompatibility (was Re: Data.fs size grows non-stop)</title>
	<published>2009-12-10T11:07:06Z</published>
	<updated>2009-12-10T11:07:06Z</updated>
	<author>
		<name>Jim Fulton</name>
	</author>
	<content type="html">On Thu, Dec 10, 2009 at 1:50 PM, Marius Gedminas &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26732788&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;marius@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Thu, Dec 10, 2009 at 12:41:11PM -0500, Jim Fulton wrote:
&lt;br&gt;&amp;gt;&amp;gt; On Thu, Dec 10, 2009 at 11:54 AM, Marius Gedminas &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26732788&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;marius@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt;&amp;gt; In 3.9 for FileStorage, if you give a starting tid that is toward the
&lt;br&gt;&amp;gt;&amp;gt; end of the file,
&lt;br&gt;&amp;gt;&amp;gt; it will scan backward, saving a lot of time.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Ah, but how can I get a valid tid that is toward the end of the file?
&lt;br&gt;&amp;gt; I assume that if I give a tid that doesn't exist, I'll get an error --
&lt;br&gt;&amp;gt; which is the behavior oldstate() exhibits -- rather than the next
&lt;br&gt;&amp;gt; existing transaction after that timestamp, or I could fudge by getting
&lt;br&gt;&amp;gt; the current timestamp and subtracting 24 hours.
&lt;/div&gt;&lt;br&gt;No, the iterator starts at the first transactions who's tid is &amp;gt;= the start tid.
&lt;br&gt;&lt;br&gt;So, guess a time and use repr(ZODB.TimeStamp.TimeStamp(...))
&lt;br&gt;&lt;br&gt;Jim
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Jim Fulton
&lt;br&gt;_______________________________________________
&lt;br&gt;For more information about ZODB, see the ZODB Wiki:
&lt;br&gt;&lt;a href=&quot;http://www.zope.org/Wikis/ZODB/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.zope.org/Wikis/ZODB/&lt;/a&gt;&lt;br&gt;&lt;br&gt;ZODB-Dev mailing list &amp;nbsp;- &amp;nbsp;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26732788&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ZODB-Dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.zope.org/mailman/listinfo/zodb-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.zope.org/mailman/listinfo/zodb-dev&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/ZODB-3.9-3.8-incompatibility-%28was-Re%3A-Data.fs-size-grows-non-stop%29-tp26714772p26732788.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26732540</id>
	<title>Re: ZODB 3.9/3.8 incompatibility (was Re: Data.fs size grows non-stop)</title>
	<published>2009-12-10T10:50:27Z</published>
	<updated>2009-12-10T10:50:27Z</updated>
	<author>
		<name>Marius Gedminas-4</name>
	</author>
	<content type="html">On Thu, Dec 10, 2009 at 12:41:11PM -0500, Jim Fulton wrote:
&lt;div class='shrinkable-quote'&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Thu, Dec 10, 2009 at 11:54 AM, Marius Gedminas &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26732540&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;marius@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; ...
&lt;br&gt;&amp;gt; &amp;gt; Well, there is IStorage, and I think all storages (except for
&lt;br&gt;&amp;gt; &amp;gt; FileStorage) implemented it faithfully
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I guess that depends on what you mean by faithfully. MappingStorage
&lt;br&gt;&amp;gt; and Demostorage
&lt;br&gt;&amp;gt; in 3.8 inherited a null implementation from BaseStorage and it's
&lt;br&gt;&amp;gt; arguable how faithful that
&lt;br&gt;&amp;gt; implementation is.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; (oid,
&lt;br&gt;&amp;gt; &amp;gt; version-that-got-removed-in-3.9, size=1).  FileStorage in 3.8 violated
&lt;br&gt;&amp;gt; &amp;gt; the interface by renaming size=1 to length=1, but it's fixed in 3.9.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; and in 3.8.
&lt;/div&gt;&lt;/div&gt;*checks*
&lt;br&gt;&lt;br&gt;FileStorage in 3.8.1 violated the interface, to be precise.
&lt;br&gt;&lt;br&gt;ZODB 3.8.1 is mandated by
&lt;br&gt;&lt;a href=&quot;http://download.zope.org/zope3.4/3.4.0/versions.cfg&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://download.zope.org/zope3.4/3.4.0/versions.cfg&lt;/a&gt;, which our
&lt;br&gt;production app currently uses.
&lt;br&gt;&lt;br&gt;(Kinda offtopic: Is there a newer 3.4 KGS release?
&lt;br&gt;&lt;a href=&quot;http://download.zope.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://download.zope.org/&lt;/a&gt;&amp;nbsp;tells me &amp;quot;Welcome&amp;quot; and nothing more.
&lt;br&gt;&lt;a href=&quot;http://download.zope.org/zope3.4/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://download.zope.org/zope3.4/&lt;/a&gt;&amp;nbsp;tells me in great big joyful letters
&lt;br&gt;at the top of the page &amp;quot;zope 3.4.0 Has Been Released!&amp;quot;)
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;gt; What I miss _a lot_ is a way to look at the last several transactions.
&lt;br&gt;&amp;gt; &amp;gt; There's the iterator API, but it goes from oldest-to-latest, and when
&lt;br&gt;&amp;gt; &amp;gt; you've got a large DB, that takes a while (85 seconds for a Data.fs with
&lt;br&gt;&amp;gt; &amp;gt; 922737 transactions and 8 GB of data, with 100 MB/s read throughput).
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; In 3.9 for FileStorage, if you give a starting tid that is toward the
&lt;br&gt;&amp;gt; end of the file,
&lt;br&gt;&amp;gt; it will scan backward, saving a lot of time.
&lt;br&gt;&lt;br&gt;Ah, but how can I get a valid tid that is toward the end of the file?
&lt;br&gt;I assume that if I give a tid that doesn't exist, I'll get an error --
&lt;br&gt;which is the behavior oldstate() exhibits -- rather than the next
&lt;br&gt;existing transaction after that timestamp, or I could fudge by getting
&lt;br&gt;the current timestamp and subtracting 24 hours.
&lt;br&gt;&lt;br&gt;&amp;gt; I've attached an analysis script that illustrates iterating backward.
&lt;br&gt;&lt;br&gt;Thank you!
&lt;br&gt;&lt;br&gt;(Mutt is inconvenient: there's no way to look at attachments while you're
&lt;br&gt;replying to a message.)
&lt;br&gt;&lt;br&gt;&amp;gt; Someday, someone should get around to adding an option to the file-storage
&lt;br&gt;&amp;gt; iterator to go backward.
&lt;br&gt;&lt;br&gt;Marius Gedminas
&lt;br&gt;-- 
&lt;br&gt;Life begins when you can spend your spare time programming instead of
&lt;br&gt;watching television.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -- Cal Keegan
&lt;br&gt;&lt;br /&gt; &lt;br /&gt;_______________________________________________
&lt;br&gt;For more information about ZODB, see the ZODB Wiki:
&lt;br&gt;&lt;a href=&quot;http://www.zope.org/Wikis/ZODB/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.zope.org/Wikis/ZODB/&lt;/a&gt;&lt;br&gt;&lt;br&gt;ZODB-Dev mailing list &amp;nbsp;- &amp;nbsp;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26732540&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ZODB-Dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.zope.org/mailman/listinfo/zodb-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.zope.org/mailman/listinfo/zodb-dev&lt;/a&gt;&lt;br&gt;&lt;div class=&quot;small&quot;&gt;&lt;br/&gt;&lt;img src=&quot;http://old.nabble.com/images/icon_attachment.gif&quot; &gt; &lt;strong&gt;signature.asc&lt;/strong&gt; (196 bytes) &lt;a href=&quot;http://old.nabble.com/attachment/26732540/0/signature.asc&quot; target=&quot;_top&quot;&gt;Download Attachment&lt;/a&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/ZODB-3.9-3.8-incompatibility-%28was-Re%3A-Data.fs-size-grows-non-stop%29-tp26714772p26732540.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26731545</id>
	<title>Re: ZODB 3.9/3.8 incompatibility (was Re: Data.fs size grows non-stop)</title>
	<published>2009-12-10T09:41:11Z</published>
	<updated>2009-12-10T09:41:11Z</updated>
	<author>
		<name>Jim Fulton</name>
	</author>
	<content type="html">On Thu, Dec 10, 2009 at 11:54 AM, Marius Gedminas &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26731545&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;marius@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;...
&lt;br&gt;&amp;gt; Well, there is IStorage, and I think all storages (except for
&lt;br&gt;&amp;gt; FileStorage) implemented it faithfully
&lt;br&gt;&lt;br&gt;I guess that depends on what you mean by faithfully. MappingStorage
&lt;br&gt;and Demostorage
&lt;br&gt;in 3.8 inherited a null implementation from BaseStorage and it's
&lt;br&gt;arguable how faithful that
&lt;br&gt;implementation is.
&lt;br&gt;&lt;br&gt;&amp;gt; (oid,
&lt;br&gt;&amp;gt; version-that-got-removed-in-3.9, size=1).  FileStorage in 3.8 violated
&lt;br&gt;&amp;gt; the interface by renaming size=1 to length=1, but it's fixed in 3.9.
&lt;br&gt;&lt;br&gt;and in 3.8.
&lt;br&gt;&lt;br&gt;...
&lt;br&gt;&lt;br&gt;&amp;gt; What I miss _a lot_ is a way to look at the last several transactions.
&lt;br&gt;&amp;gt; There's the iterator API, but it goes from oldest-to-latest, and when
&lt;br&gt;&amp;gt; you've got a large DB, that takes a while (85 seconds for a Data.fs with
&lt;br&gt;&amp;gt; 922737 transactions and 8 GB of data, with 100 MB/s read throughput).
&lt;br&gt;&lt;br&gt;In 3.9 for FileStorage, if you give a starting tid that is toward the
&lt;br&gt;end of the file,
&lt;br&gt;it will scan backward, saving a lot of time.
&lt;br&gt;&lt;br&gt;I've attached an analysis script that illustrates iterating backward.
&lt;br&gt;Someday, someone should get around to adding an option to the file-storage
&lt;br&gt;iterator to go backward.
&lt;br&gt;&lt;br&gt;Jim
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Jim Fulton
&lt;br&gt;&lt;br /&gt; &lt;br /&gt;_______________________________________________
&lt;br&gt;For more information about ZODB, see the ZODB Wiki:
&lt;br&gt;&lt;a href=&quot;http://www.zope.org/Wikis/ZODB/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.zope.org/Wikis/ZODB/&lt;/a&gt;&lt;br&gt;&lt;br&gt;ZODB-Dev mailing list &amp;nbsp;- &amp;nbsp;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26731545&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ZODB-Dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.zope.org/mailman/listinfo/zodb-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.zope.org/mailman/listinfo/zodb-dev&lt;/a&gt;&lt;br&gt;&lt;div class=&quot;small&quot;&gt;&lt;br/&gt;&lt;img src=&quot;http://old.nabble.com/images/icon_attachment.gif&quot; &gt; &lt;strong&gt;transaction_rates.py&lt;/strong&gt; (2K) &lt;a href=&quot;http://old.nabble.com/attachment/26731545/0/transaction_rates.py&quot; target=&quot;_top&quot;&gt;Download Attachment&lt;/a&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/ZODB-3.9-3.8-incompatibility-%28was-Re%3A-Data.fs-size-grows-non-stop%29-tp26714772p26731545.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26730726</id>
	<title>Re: ZODB 3.9/3.8 incompatibility (was Re: Data.fs size grows non-stop)</title>
	<published>2009-12-10T08:54:57Z</published>
	<updated>2009-12-10T08:54:57Z</updated>
	<author>
		<name>Marius Gedminas-4</name>
	</author>
	<content type="html">On Thu, Dec 10, 2009 at 10:08:36AM -0500, Jim Fulton wrote:
&lt;div class='shrinkable-quote'&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Thu, Dec 10, 2009 at 5:58 AM, Marius Gedminas &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26730726&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;marius@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; &amp;gt; On Wed, Dec 09, 2009 at 01:04:03PM -0500, Jim Fulton wrote:
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; On Wed, Dec 9, 2009 at 12:06 PM, Marius Gedminas &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26730726&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;marius@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; ...
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt; (Supporting both ZODB 3.8 and 3.9 is kinda tricky, but with some very
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt; ugly hacks I managed.)
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; This sounds like something that needs to be fixed. Can you share some of the
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; issues you ran into? (Or maybe file bugs reports.)
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Two issues only:
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;  * In ZODB 3.8 PersistentDict and PersistentMapping are unrelated
&lt;br&gt;&amp;gt; &amp;gt;    classes, so if I want to have adapters for both, I have to register
&lt;br&gt;&amp;gt; &amp;gt;    them separately in ZCML.  In ZODB 3.9, PersistentDict is an alias
&lt;br&gt;&amp;gt; &amp;gt;    for PersistentMapping, so I get a ZCML configuration conflict error
&lt;br&gt;&amp;gt; &amp;gt;    if I have adapter directives for both.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; OK, it's impractical to do anything about this.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;    Solved by defining a decoy class for one of the adapters so they
&lt;br&gt;&amp;gt; &amp;gt;    don't conflict.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Hm, I'm not sure I follow this. 
&lt;/div&gt;&lt;/div&gt;Code:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; if PersistentMapping is PersistentDict:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # &amp;lt;...snip large comment explaining this...&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; class DecoyPersistentDict(PersistentMapping):
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;quot;&amp;quot;&amp;quot;Decoy to avoid ZCML errors while supporting both ZODB 3.8 and 3.9.&amp;quot;&amp;quot;&amp;quot;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; class PersistentDictState(PersistentMappingState):
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;quot;&amp;quot;&amp;quot;Decoy to avoid ZCML errors while supporting both ZODB 3.8 and 3.9.&amp;quot;&amp;quot;&amp;quot;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; adapts(DecoyPersistentDict, dict, None)
&lt;br&gt;&amp;nbsp; &amp;nbsp; else:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; class PersistentDictState(PersistentMappingState):
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;quot;&amp;quot;&amp;quot;Convenient access to a persistent dict's items.&amp;quot;&amp;quot;&amp;quot;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; adapts(PersistentDict, dict, None)
&lt;br&gt;&lt;br&gt;ZCML:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;lt;adapter factory=&amp;quot;.state.PersistentDictState&amp;quot; /&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;lt;adapter factory=&amp;quot;.state.PersistentMappingState&amp;quot; /&amp;gt;
&lt;br&gt;&lt;br&gt;&amp;gt; You could have used a different
&lt;br&gt;&amp;gt; approach of providing the second adapter registration as an override.
&lt;br&gt;&lt;br&gt;Oooh, neat hack. &amp;nbsp;But I'm not sure I like it better than the one I
&lt;br&gt;implemented.
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;gt;  * In ZODB 3.8, the 'version' argument of ClientStorage.history (as well
&lt;br&gt;&amp;gt; &amp;gt;    as other kinds of storages, I suppose) is mandatory.  In ZODB 3.9
&lt;br&gt;&amp;gt; &amp;gt;    it's gone.
&lt;br&gt;&lt;br&gt;I went back and corrected my statement (originally it referred to
&lt;br&gt;FileStorage.history, and I was thinking about ClientStorage in my
&lt;br&gt;parenthetical statement), and then I of course forgot to remove the
&lt;br&gt;now-obsolete parenthetical statement itself.
&lt;br&gt;&lt;br&gt;&amp;gt; It's mandatory in ClientStorage and optional in FileStorage. (MappingStorage and
&lt;br&gt;&amp;gt; DemoStorage don't have a history method in 3.8.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I suggest we treat this as a bug in 3.8 and make the version argument
&lt;br&gt;&amp;gt; to ClientStorage's history method optional in a 3.8 bug fix release.
&lt;br&gt;&lt;br&gt;+1
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;gt;    Solved by peeking into the method signature with inspect.getargspec()
&lt;br&gt;&amp;gt; &amp;gt;    and supplying a version only if it's needed.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Ick. :)
&lt;br&gt;&lt;br&gt;:)
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; In particular, I think it should be a goal that it isn't too hard to
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; write code that works with both ZODB 3.8 and 3.9.
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Normal code doesn't usually play with storage.history, I'd say, so I'm
&lt;br&gt;&amp;gt; &amp;gt; not too peeved by having to do various contortions.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Zope 2 had (has?) a standard view for looking at an object's history
&lt;br&gt;&amp;gt; that I found very useful. I wish there was one for Zope3.
&lt;br&gt;&lt;br&gt;Well, there is IStorage, and I think all storages (except for
&lt;br&gt;FileStorage) implemented it faithfully (oid,
&lt;br&gt;version-that-got-removed-in-3.9, size=1). &amp;nbsp;FileStorage in 3.8 violated
&lt;br&gt;the interface by renaming size=1 to length=1, but it's fixed in 3.9.
&lt;br&gt;&lt;br&gt;I personally would like to be able to have size=None imply &amp;quot;unlimited,
&lt;br&gt;give me as much as you've got&amp;quot;), but 9999999999999999 works just as well
&lt;br&gt;in practice.
&lt;br&gt;&lt;br&gt;What I miss _a lot_ is a way to look at the last several transactions.
&lt;br&gt;There's the iterator API, but it goes from oldest-to-latest, and when
&lt;br&gt;you've got a large DB, that takes a while (85 seconds for a Data.fs with
&lt;br&gt;922737 transactions and 8 GB of data, with 100 MB/s read throughput).
&lt;br&gt;&lt;br&gt;&amp;gt; History can be very useful in my experience.
&lt;br&gt;&lt;br&gt;Oh yes. &amp;nbsp;This is why I stopped packing my production Data.fs'es and
&lt;br&gt;first started using storage.history() with a couple of nice wrappers
&lt;br&gt;from debugzope shell, and, later, convinced a coworker to write
&lt;br&gt;ZODBBrowser.
&lt;br&gt;&lt;br&gt;Marius Gedminas
&lt;br&gt;-- 
&lt;br&gt;I used to think I was indecisive, but now I'm not so sure.
&lt;br&gt;&lt;br /&gt; &lt;br /&gt;_______________________________________________
&lt;br&gt;For more information about ZODB, see the ZODB Wiki:
&lt;br&gt;&lt;a href=&quot;http://www.zope.org/Wikis/ZODB/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.zope.org/Wikis/ZODB/&lt;/a&gt;&lt;br&gt;&lt;br&gt;ZODB-Dev mailing list &amp;nbsp;- &amp;nbsp;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26730726&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ZODB-Dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.zope.org/mailman/listinfo/zodb-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.zope.org/mailman/listinfo/zodb-dev&lt;/a&gt;&lt;br&gt;&lt;div class=&quot;small&quot;&gt;&lt;br/&gt;&lt;img src=&quot;http://old.nabble.com/images/icon_attachment.gif&quot; &gt; &lt;strong&gt;signature.asc&lt;/strong&gt; (196 bytes) &lt;a href=&quot;http://old.nabble.com/attachment/26730726/0/signature.asc&quot; target=&quot;_top&quot;&gt;Download Attachment&lt;/a&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/ZODB-3.9-3.8-incompatibility-%28was-Re%3A-Data.fs-size-grows-non-stop%29-tp26714772p26730726.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26730036</id>
	<title>Re: Data.fs size grows non-stop</title>
	<published>2009-12-10T08:12:48Z</published>
	<updated>2009-12-10T08:12:48Z</updated>
	<author>
		<name>Roger Ineichen</name>
	</author>
	<content type="html">Hi Pedro 
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Betreff: Re: AW: [ZODB-Dev] Data.fs size grows non-stop
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; If you need performance, take a look at the z3c.indexer 
&lt;br&gt;&amp;gt; package which 
&lt;br&gt;&amp;gt; &amp;gt; offers a much faster indexing concept. I implemented this package 
&lt;br&gt;&amp;gt; &amp;gt; because my app coudn't handle the implicit default indexing 
&lt;br&gt;&amp;gt; handling. 
&lt;br&gt;&amp;gt; &amp;gt; The README.txt explains what is different and how to use it. It 
&lt;br&gt;&amp;gt; &amp;gt; defently needs some work to implement a z3c.indexer based indexing 
&lt;br&gt;&amp;gt; &amp;gt; concept but if you do it right, it can handle a lot more indexing 
&lt;br&gt;&amp;gt; &amp;gt; tasks then the generic zope or zc.catalog concept.
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; 
&lt;br&gt;&amp;gt; Thanks a lot. But is it easy to use this from within a 
&lt;br&gt;&amp;gt; non-Zope application? In the examples I could see references 
&lt;br&gt;&amp;gt; to several zope.site classes, such as LocalSiteManager... 
&lt;br&gt;&amp;gt; since this is a standalone app, I wonder if it won't force us 
&lt;br&gt;&amp;gt; to import some other zope packages...
&lt;/div&gt;&lt;br&gt;The site is only used as a sample setup and for provide
&lt;br&gt;a local persistent IIntIds utility.
&lt;br&gt;&lt;br&gt;Every zope catalog implementation needs an object id
&lt;br&gt;normaly an id given from IIntIds.
&lt;br&gt;&lt;br&gt;But if your app provides another unique integer id
&lt;br&gt;for each object, you can use the z3c.indexer package 
&lt;br&gt;with small modifications.
&lt;br&gt;&lt;br&gt;But of corse it will bring in some dependencies,
&lt;br&gt;but not more then the zope or zc.catalog will.
&lt;br&gt;&lt;br&gt;Let me know if you could use the package with less
&lt;br&gt;dependencies then we have now and we can try to cut
&lt;br&gt;the dependencies down or probably defined them as test
&lt;br&gt;dependencies
&lt;br&gt;&lt;br&gt;Regards
&lt;br&gt;Roger Ineichen 
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Pedro
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; Pedro
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; _______________________________________________
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; For more information about ZODB, see the ZODB Wiki:
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &lt;a href=&quot;http://www.zope.org/Wikis/ZODB/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.zope.org/Wikis/ZODB/&lt;/a&gt;&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; ZODB-Dev mailing list &amp;nbsp;- &amp;nbsp;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26730036&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ZODB-Dev@...&lt;/a&gt; 
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &lt;a href=&quot;https://mail.zope.org/mailman/listinfo/zodb-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.zope.org/mailman/listinfo/zodb-dev&lt;/a&gt;&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;For more information about ZODB, see the ZODB Wiki:
&lt;br&gt;&lt;a href=&quot;http://www.zope.org/Wikis/ZODB/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.zope.org/Wikis/ZODB/&lt;/a&gt;&lt;br&gt;&lt;br&gt;ZODB-Dev mailing list &amp;nbsp;- &amp;nbsp;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26730036&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ZODB-Dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.zope.org/mailman/listinfo/zodb-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.zope.org/mailman/listinfo/zodb-dev&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/cache-size-bytes-usable--tp26246822p26730036.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26728827</id>
	<title>Re: ZODB 3.9/3.8 incompatibility (was Re: Data.fs size grows non-stop)</title>
	<published>2009-12-10T07:08:36Z</published>
	<updated>2009-12-10T07:08:36Z</updated>
	<author>
		<name>Jim Fulton</name>
	</author>
	<content type="html">On Thu, Dec 10, 2009 at 5:58 AM, Marius Gedminas &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26728827&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;marius@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Wed, Dec 09, 2009 at 01:04:03PM -0500, Jim Fulton wrote:
&lt;br&gt;&amp;gt;&amp;gt; On Wed, Dec 9, 2009 at 12:06 PM, Marius Gedminas &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26728827&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;marius@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt;&amp;gt; ...
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; (Supporting both ZODB 3.8 and 3.9 is kinda tricky, but with some very
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; ugly hacks I managed.)
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; This sounds like something that needs to be fixed. Can you share some of the
&lt;br&gt;&amp;gt;&amp;gt; issues you ran into? (Or maybe file bugs reports.)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Two issues only:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;  * In ZODB 3.8 PersistentDict and PersistentMapping are unrelated
&lt;br&gt;&amp;gt;    classes, so if I want to have adapters for both, I have to register
&lt;br&gt;&amp;gt;    them separately in ZCML.  In ZODB 3.9, PersistentDict is an alias
&lt;br&gt;&amp;gt;    for PersistentMapping, so I get a ZCML configuration conflict error
&lt;br&gt;&amp;gt;    if I have adapter directives for both.
&lt;/div&gt;&lt;br&gt;OK, it's impractical to do anything about this.
&lt;br&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;    Solved by defining a decoy class for one of the adapters so they
&lt;br&gt;&amp;gt;    don't conflict.
&lt;br&gt;&lt;br&gt;Hm, I'm not sure I follow this. &amp;nbsp;You could have used a different
&lt;br&gt;approach of providing the second adapter registration as an override.
&lt;br&gt;&lt;br&gt;&amp;gt;  * In ZODB 3.8, the 'version' argument of ClientStorage.history (as well
&lt;br&gt;&amp;gt;    as other kinds of storages, I suppose) is mandatory.  In ZODB 3.9
&lt;br&gt;&amp;gt;    it's gone.
&lt;br&gt;&lt;br&gt;It's mandatory in ClientStorage and optional in FileStorage. (MappingStorage and
&lt;br&gt;DemoStorage don't have a history method in 3.8.
&lt;br&gt;&lt;br&gt;I suggest we treat this as a bug in 3.8 and make the version argument
&lt;br&gt;to ClientStorage's history method optional in a 3.8 bug fix release.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;gt;    Solved by peeking into the method signature with inspect.getargspec()
&lt;br&gt;&amp;gt;    and supplying a version only if it's needed.
&lt;br&gt;&lt;br&gt;Ick. :)
&lt;br&gt;&lt;br&gt;&amp;gt;&amp;gt; In particular, I think it should be a goal that it isn't too hard to
&lt;br&gt;&amp;gt;&amp;gt; write code that works with both ZODB 3.8 and 3.9.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Normal code doesn't usually play with storage.history, I'd say, so I'm
&lt;br&gt;&amp;gt; not too peeved by having to do various contortions.
&lt;br&gt;&lt;br&gt;Zope 2 had (has?) a standard view for looking at an object's history
&lt;br&gt;that I found very useful. I wish there was one for Zope3.
&lt;br&gt;&lt;br&gt;History can be very useful in my experience.
&lt;br&gt;&lt;br&gt;Jim
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Jim Fulton
&lt;br&gt;_______________________________________________
&lt;br&gt;For more information about ZODB, see the ZODB Wiki:
&lt;br&gt;&lt;a href=&quot;http://www.zope.org/Wikis/ZODB/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.zope.org/Wikis/ZODB/&lt;/a&gt;&lt;br&gt;&lt;br&gt;ZODB-Dev mailing list &amp;nbsp;- &amp;nbsp;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26728827&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ZODB-Dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.zope.org/mailman/listinfo/zodb-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.zope.org/mailman/listinfo/zodb-dev&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/ZODB-3.9-3.8-incompatibility-%28was-Re%3A-Data.fs-size-grows-non-stop%29-tp26714772p26728827.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26728626</id>
	<title>Re: Data.fs size grows non-stop</title>
	<published>2009-12-10T06:58:51Z</published>
	<updated>2009-12-10T06:58:51Z</updated>
	<author>
		<name>Jim Fulton</name>
	</author>
	<content type="html">On Thu, Dec 10, 2009 at 4:06 AM, Pedro Ferreira
&lt;br&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26728626&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jose.pedro.ferreira@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Jim Fulton wrote:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; On Wed, Dec 9, 2009 at 10:54 AM, Pedro Ferreira
&lt;br&gt;&amp;gt;&amp;gt; &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26728626&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jose.pedro.ferreira@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt;&amp;gt; ...
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Well, at least we won't have to rewrite the whole bucket... but still, it
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; would be much nicer to fragment the list
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; in smaller chunks. We could use an OOBTree instead... but something less
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; complex would suffice... any suggestions?
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; It's hard for people to suggest something without knowing your usage
&lt;br&gt;&amp;gt;&amp;gt; pattern.
&lt;br&gt;&amp;gt;&amp;gt; Do you want something that is effectively a set?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; The situation is simple: we have events (objects) that have to be indexed by
&lt;br&gt;&amp;gt; date. We currently use an OOBTree with the days as keys and lists of objects
&lt;br&gt;&amp;gt; as values. The objective is to avoid rewriting these lists each time
&lt;br&gt;&amp;gt; something changes, since we can have tens of thousands of events in the same
&lt;br&gt;&amp;gt; day. Some kind of btree-based list or set would work, I guess.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Is integer indexing important?
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Well, it's an index of dates, so, I guess we could use integers as keys
&lt;br&gt;&amp;gt; instead of strings, as we are now.
&lt;/div&gt;&lt;br&gt;I wasn't referring to indexing at that level. You were using lists
&lt;br&gt;rather than sets
&lt;br&gt;and I was wondering whether there was a reason for that.
&lt;br&gt;&lt;br&gt;It sounds like a data structure with minimal container semantics
&lt;br&gt;would be fine to store the events for a day.
&lt;br&gt;&lt;br&gt;If you can arrange that the events have a stable ordering such that
&lt;br&gt;no 2 events are equal, then you can use OOTreeSets rather than
&lt;br&gt;lists.
&lt;br&gt;&lt;br&gt;Jim
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Jim Fulton
&lt;br&gt;_______________________________________________
&lt;br&gt;For more information about ZODB, see the ZODB Wiki:
&lt;br&gt;&lt;a href=&quot;http://www.zope.org/Wikis/ZODB/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.zope.org/Wikis/ZODB/&lt;/a&gt;&lt;br&gt;&lt;br&gt;ZODB-Dev mailing list &amp;nbsp;- &amp;nbsp;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26728626&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ZODB-Dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.zope.org/mailman/listinfo/zodb-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.zope.org/mailman/listinfo/zodb-dev&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/cache-size-bytes-usable--tp26246822p26728626.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26728301</id>
	<title>Re: Data.fs size grows non-stop</title>
	<published>2009-12-10T06:38:09Z</published>
	<updated>2009-12-10T06:38:09Z</updated>
	<author>
		<name>Pedro Ferreira-7</name>
	</author>
	<content type="html">Hello,
&lt;br&gt;&amp;gt; Are the values in your BTree implemented as persistent lists or some
&lt;br&gt;&amp;gt; other subclass of Persistent? &amp;nbsp;That makes a big difference in the size
&lt;br&gt;&amp;gt; of each commit to the BTree.
&lt;br&gt;&amp;gt; &amp;nbsp; 
&lt;br&gt;Yes, that is exactly the problem. We are using simple Python lists, and 
&lt;br&gt;that implies rewriting the whole bucket.
&lt;br&gt;Still, rewriting only the list won't be the best solution, since they 
&lt;br&gt;can be pretty big sometimes. That's why I was looking for something like 
&lt;br&gt;a BTree-based list (that actually seems to exist).
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;&lt;br&gt;Pedro
&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;For more information about ZODB, see the ZODB Wiki:
&lt;br&gt;&lt;a href=&quot;http://www.zope.org/Wikis/ZODB/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.zope.org/Wikis/ZODB/&lt;/a&gt;&lt;br&gt;&lt;br&gt;ZODB-Dev mailing list &amp;nbsp;- &amp;nbsp;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26728301&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ZODB-Dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.zope.org/mailman/listinfo/zodb-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.zope.org/mailman/listinfo/zodb-dev&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/cache-size-bytes-usable--tp26246822p26728301.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26728260</id>
	<title>Re: Data.fs size grows non-stop</title>
	<published>2009-12-10T06:36:15Z</published>
	<updated>2009-12-10T06:36:15Z</updated>
	<author>
		<name>Pedro Ferreira-7</name>
	</author>
	<content type="html">&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; If you need performance, take a look at the z3c.indexer package
&lt;br&gt;&amp;gt; which offers a much faster indexing concept. I implemented
&lt;br&gt;&amp;gt; this package because my app coudn't handle the implicit default
&lt;br&gt;&amp;gt; indexing handling. The README.txt explains what is different and how 
&lt;br&gt;&amp;gt; to use it. It defently needs some work to implement a z3c.indexer
&lt;br&gt;&amp;gt; based indexing concept but if you do it right, it can handle a
&lt;br&gt;&amp;gt; lot more indexing tasks then the generic zope or zc.catalog
&lt;br&gt;&amp;gt; concept.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; 
&lt;/div&gt;Thanks a lot. But is it easy to use this from within a non-Zope 
&lt;br&gt;application? In the examples I could see references to several zope.site 
&lt;br&gt;classes, such as LocalSiteManager... since this is a standalone app, I 
&lt;br&gt;wonder if it won't force us to import some other zope packages...
&lt;br&gt;&lt;br&gt;Pedro
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;&amp;gt; Pedro
&lt;br&gt;&amp;gt;&amp;gt; _______________________________________________
&lt;br&gt;&amp;gt;&amp;gt; For more information about ZODB, see the ZODB Wiki:
&lt;br&gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://www.zope.org/Wikis/ZODB/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.zope.org/Wikis/ZODB/&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; ZODB-Dev mailing list &amp;nbsp;- &amp;nbsp;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26728260&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ZODB-Dev@...&lt;/a&gt; 
&lt;br&gt;&amp;gt;&amp;gt; &lt;a href=&quot;https://mail.zope.org/mailman/listinfo/zodb-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.zope.org/mailman/listinfo/zodb-dev&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; 
&lt;/div&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;For more information about ZODB, see the ZODB Wiki:
&lt;br&gt;&lt;a href=&quot;http://www.zope.org/Wikis/ZODB/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.zope.org/Wikis/ZODB/&lt;/a&gt;&lt;br&gt;&lt;br&gt;ZODB-Dev mailing list &amp;nbsp;- &amp;nbsp;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26728260&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ZODB-Dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.zope.org/mailman/listinfo/zodb-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.zope.org/mailman/listinfo/zodb-dev&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/cache-size-bytes-usable--tp26246822p26728260.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26727209</id>
	<title>Re: Data.fs size grows non-stop</title>
	<published>2009-12-10T05:29:38Z</published>
	<updated>2009-12-10T05:29:38Z</updated>
	<author>
		<name>Roger Ineichen</name>
	</author>
	<content type="html">Hi Pedro 
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Betreff: Re: [ZODB-Dev] Data.fs size grows non-stop
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; Why not store the events on some BTree or similar structure with a 
&lt;br&gt;&amp;gt; &amp;gt; simple unique integer id, and use a separate BTree to map dates to 
&lt;br&gt;&amp;gt; &amp;gt; these events? You can even use zc.catalog or similar tools 
&lt;br&gt;&amp;gt; to create 
&lt;br&gt;&amp;gt; &amp;gt; that mapping - you would get a lot of query options for 
&lt;br&gt;&amp;gt; free with those as well.
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; 
&lt;br&gt;&amp;gt; Yeah, that would require a lot of changes, but it would be 
&lt;br&gt;&amp;gt; definitely great. What does zc.catalog have that zope.catalog 
&lt;br&gt;&amp;gt; doesn't, by the way?
&lt;/div&gt;&lt;br&gt;If you need performance, take a look at the z3c.indexer package
&lt;br&gt;which offers a much faster indexing concept. I implemented
&lt;br&gt;this package because my app coudn't handle the implicit default
&lt;br&gt;indexing handling. The README.txt explains what is different and how 
&lt;br&gt;to use it. It defently needs some work to implement a z3c.indexer
&lt;br&gt;based indexing concept but if you do it right, it can handle a
&lt;br&gt;lot more indexing tasks then the generic zope or zc.catalog
&lt;br&gt;concept.
&lt;br&gt;&lt;br&gt;Here are some performance data:
&lt;br&gt;&lt;br&gt;z3c.indexer
&lt;br&gt;indexer based indexing time: &amp;nbsp;2.47 s
&lt;br&gt;&lt;br&gt;zope.catalog
&lt;br&gt;catalog based indexing time: &amp;nbsp;14.41 s
&lt;br&gt;&lt;br&gt;btw,
&lt;br&gt;You can run the performance test by yourself
&lt;br&gt;located in the z3c.indexer package.
&lt;br&gt;&lt;br&gt;Regards
&lt;br&gt;Roger Ineichen
&lt;br&gt;&lt;br&gt;&amp;gt; Pedro
&lt;br&gt;&amp;gt; _______________________________________________
&lt;br&gt;&amp;gt; For more information about ZODB, see the ZODB Wiki:
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.zope.org/Wikis/ZODB/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.zope.org/Wikis/ZODB/&lt;/a&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; ZODB-Dev mailing list &amp;nbsp;- &amp;nbsp;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26727209&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ZODB-Dev@...&lt;/a&gt; 
&lt;br&gt;&amp;gt; &lt;a href=&quot;https://mail.zope.org/mailman/listinfo/zodb-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.zope.org/mailman/listinfo/zodb-dev&lt;/a&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;For more information about ZODB, see the ZODB Wiki:
&lt;br&gt;&lt;a href=&quot;http://www.zope.org/Wikis/ZODB/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.zope.org/Wikis/ZODB/&lt;/a&gt;&lt;br&gt;&lt;br&gt;ZODB-Dev mailing list &amp;nbsp;- &amp;nbsp;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26727209&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ZODB-Dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.zope.org/mailman/listinfo/zodb-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.zope.org/mailman/listinfo/zodb-dev&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/cache-size-bytes-usable--tp26246822p26727209.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26726092</id>
	<title>Re: ZODB 3.9/3.8 incompatibility (was Re: Data.fs size grows non-stop)</title>
	<published>2009-12-10T03:57:25Z</published>
	<updated>2009-12-10T03:57:25Z</updated>
	<author>
		<name>Marius Gedminas-4</name>
	</author>
	<content type="html">On Thu, Dec 10, 2009 at 11:08:25AM +0000, Chris Withers wrote:
&lt;div class='shrinkable-quote'&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Marius Gedminas wrote:
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; * In ZODB 3.8, the 'version' argument of ClientStorage.history (as well
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; as other kinds of storages, I suppose) is mandatory. &amp;nbsp;In ZODB 3.9
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; it's gone.
&lt;br&gt;&amp;gt; &amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; Solved by peeking into the method signature with inspect.getargspec()
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; and supplying a version only if it's needed.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I believe this may be fixed with 3.9.4 is released.
&lt;br&gt;&amp;gt; ...but it sounds like your code isn't ending up using the Z303 adapter, 
&lt;br&gt;&amp;gt; which is why you're running into the problem.
&lt;/div&gt;&lt;/div&gt;What's Z303?
&lt;br&gt;&lt;br&gt;&amp;gt; How are you mixing versions? 3.8 on client and 3.9 on server or?
&lt;br&gt;&lt;br&gt;I'm not mixing versions at runtime; my intent is to write code that
&lt;br&gt;works with either ZODB 3.8.x or 3.9.x.
&lt;br&gt;&lt;br&gt;You can see it here in all its glory:
&lt;br&gt;&lt;a href=&quot;http://bazaar.launchpad.net/~zodbbrowser-dev/zodbbrowser/trunk/annotate/head:/src/zodbbrowser/history.py#L30&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://bazaar.launchpad.net/~zodbbrowser-dev/zodbbrowser/trunk/annotate/head:/src/zodbbrowser/history.py#L30&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://bazaar.launchpad.net/~zodbbrowser-dev/zodbbrowser/trunk/annotate/head:/src/zodbbrowser/state.py#L115&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://bazaar.launchpad.net/~zodbbrowser-dev/zodbbrowser/trunk/annotate/head:/src/zodbbrowser/state.py#L115&lt;/a&gt;&lt;br&gt;&lt;br&gt;&amp;gt; (sorry, I lost the previous thread and saw this as a new one when Jim 
&lt;br&gt;&amp;gt; changed the subject line...)
&lt;br&gt;&lt;br&gt;This is a new topic, completely unrelated to the previous thread.
&lt;br&gt;&lt;br&gt;Marius Gedminas
&lt;br&gt;-- 
&lt;br&gt;I'm a shareware signature! &amp;nbsp;Send $2 if you use me, $10 for a manual.
&lt;br&gt;&lt;br /&gt; &lt;br /&gt;_______________________________________________
&lt;br&gt;For more information about ZODB, see the ZODB Wiki:
&lt;br&gt;&lt;a href=&quot;http://www.zope.org/Wikis/ZODB/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.zope.org/Wikis/ZODB/&lt;/a&gt;&lt;br&gt;&lt;br&gt;ZODB-Dev mailing list &amp;nbsp;- &amp;nbsp;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26726092&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ZODB-Dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.zope.org/mailman/listinfo/zodb-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.zope.org/mailman/listinfo/zodb-dev&lt;/a&gt;&lt;br&gt;&lt;div class=&quot;small&quot;&gt;&lt;br/&gt;&lt;img src=&quot;http://old.nabble.com/images/icon_attachment.gif&quot; &gt; &lt;strong&gt;signature.asc&lt;/strong&gt; (196 bytes) &lt;a href=&quot;http://old.nabble.com/attachment/26726092/0/signature.asc&quot; target=&quot;_top&quot;&gt;Download Attachment&lt;/a&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/ZODB-3.9-3.8-incompatibility-%28was-Re%3A-Data.fs-size-grows-non-stop%29-tp26714772p26726092.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26725515</id>
	<title>Re: ZODB 3.9/3.8 incompatibility (was Re: Data.fs size grows non-stop)</title>
	<published>2009-12-10T03:08:25Z</published>
	<updated>2009-12-10T03:08:25Z</updated>
	<author>
		<name>Chris Withers</name>
	</author>
	<content type="html">Marius Gedminas wrote:
&lt;br&gt;&amp;gt; &amp;nbsp; * In ZODB 3.8, the 'version' argument of ClientStorage.history (as well
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; as other kinds of storages, I suppose) is mandatory. &amp;nbsp;In ZODB 3.9
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; it's gone.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; Solved by peeking into the method signature with inspect.getargspec()
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; and supplying a version only if it's needed.
&lt;br&gt;&lt;br&gt;I believe this may be fixed with 3.9.4 is released.
&lt;br&gt;...but it sounds like your code isn't ending up using the Z303 adapter, 
&lt;br&gt;which is why you're running into the problem.
&lt;br&gt;&lt;br&gt;How are you mixing versions? 3.8 on client and 3.9 on server or?
&lt;br&gt;(sorry, I lost the previous thread and saw this as a new one when Jim 
&lt;br&gt;changed the subject line...)
&lt;br&gt;&lt;br&gt;cheers,
&lt;br&gt;&lt;br&gt;Chris
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Simplistix - Content Management, Batch Processing &amp; Python Consulting
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;- &lt;a href=&quot;http://www.simplistix.co.uk&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.simplistix.co.uk&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;For more information about ZODB, see the ZODB Wiki:
&lt;br&gt;&lt;a href=&quot;http://www.zope.org/Wikis/ZODB/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.zope.org/Wikis/ZODB/&lt;/a&gt;&lt;br&gt;&lt;br&gt;ZODB-Dev mailing list &amp;nbsp;- &amp;nbsp;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26725515&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ZODB-Dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.zope.org/mailman/listinfo/zodb-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.zope.org/mailman/listinfo/zodb-dev&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/ZODB-3.9-3.8-incompatibility-%28was-Re%3A-Data.fs-size-grows-non-stop%29-tp26714772p26725515.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26725403</id>
	<title>Re: ZODB 3.9/3.8 incompatibility (was Re: Data.fs size grows non-stop)</title>
	<published>2009-12-10T02:58:11Z</published>
	<updated>2009-12-10T02:58:11Z</updated>
	<author>
		<name>Marius Gedminas-4</name>
	</author>
	<content type="html">On Wed, Dec 09, 2009 at 01:04:03PM -0500, Jim Fulton wrote:
&lt;br&gt;&amp;gt; On Wed, Dec 9, 2009 at 12:06 PM, Marius Gedminas &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26725403&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;marius@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; ...
&lt;br&gt;&amp;gt; &amp;gt; (Supporting both ZODB 3.8 and 3.9 is kinda tricky, but with some very
&lt;br&gt;&amp;gt; &amp;gt; ugly hacks I managed.)
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; This sounds like something that needs to be fixed. Can you share some of the
&lt;br&gt;&amp;gt; issues you ran into? (Or maybe file bugs reports.)
&lt;br&gt;&lt;br&gt;Two issues only:
&lt;br&gt;&lt;br&gt;&amp;nbsp; * In ZODB 3.8 PersistentDict and PersistentMapping are unrelated
&lt;br&gt;&amp;nbsp; &amp;nbsp; classes, so if I want to have adapters for both, I have to register
&lt;br&gt;&amp;nbsp; &amp;nbsp; them separately in ZCML. &amp;nbsp;In ZODB 3.9, PersistentDict is an alias
&lt;br&gt;&amp;nbsp; &amp;nbsp; for PersistentMapping, so I get a ZCML configuration conflict error
&lt;br&gt;&amp;nbsp; &amp;nbsp; if I have adapter directives for both.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; Solved by defining a decoy class for one of the adapters so they
&lt;br&gt;&amp;nbsp; &amp;nbsp; don't conflict.
&lt;br&gt;&lt;br&gt;&amp;nbsp; * In ZODB 3.8, the 'version' argument of ClientStorage.history (as well
&lt;br&gt;&amp;nbsp; &amp;nbsp; as other kinds of storages, I suppose) is mandatory. &amp;nbsp;In ZODB 3.9
&lt;br&gt;&amp;nbsp; &amp;nbsp; it's gone.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; Solved by peeking into the method signature with inspect.getargspec()
&lt;br&gt;&amp;nbsp; &amp;nbsp; and supplying a version only if it's needed.
&lt;br&gt;&lt;br&gt;&amp;gt; In particular, I think it should be a goal that it isn't too hard to
&lt;br&gt;&amp;gt; write code that works with both ZODB 3.8 and 3.9.
&lt;br&gt;&lt;br&gt;Normal code doesn't usually play with storage.history, I'd say, so I'm
&lt;br&gt;not too peeved by having to do various contortions.
&lt;br&gt;&lt;br&gt;Marius Gedminas
&lt;br&gt;-- 
&lt;br&gt;Win32-API is wonderful : Full of things to wonder about...
&lt;br&gt;&lt;br /&gt; &lt;br /&gt;_______________________________________________
&lt;br&gt;For more information about ZODB, see the ZODB Wiki:
&lt;br&gt;&lt;a href=&quot;http://www.zope.org/Wikis/ZODB/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.zope.org/Wikis/ZODB/&lt;/a&gt;&lt;br&gt;&lt;br&gt;ZODB-Dev mailing list &amp;nbsp;- &amp;nbsp;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26725403&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ZODB-Dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.zope.org/mailman/listinfo/zodb-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.zope.org/mailman/listinfo/zodb-dev&lt;/a&gt;&lt;br&gt;&lt;div class=&quot;small&quot;&gt;&lt;br/&gt;&lt;img src=&quot;http://old.nabble.com/images/icon_attachment.gif&quot; &gt; &lt;strong&gt;signature.asc&lt;/strong&gt; (196 bytes) &lt;a href=&quot;http://old.nabble.com/attachment/26725403/0/signature.asc&quot; target=&quot;_top&quot;&gt;Download Attachment&lt;/a&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/ZODB-3.9-3.8-incompatibility-%28was-Re%3A-Data.fs-size-grows-non-stop%29-tp26714772p26725403.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26724546</id>
	<title>Re: Data.fs size grows non-stop</title>
	<published>2009-12-10T01:52:23Z</published>
	<updated>2009-12-10T01:52:23Z</updated>
	<author>
		<name>wichert</name>
	</author>
	<content type="html">On 2009-12-10 10:48, Pedro Ferreira wrote:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Why not store the events on some BTree or similar structure with a
&lt;br&gt;&amp;gt;&amp;gt; simple unique integer id, and use a separate BTree to map dates to
&lt;br&gt;&amp;gt;&amp;gt; these events? You can even use zc.catalog or similar tools to create
&lt;br&gt;&amp;gt;&amp;gt; that mapping - you would get a lot of query options for free with
&lt;br&gt;&amp;gt;&amp;gt; those as well.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; Yeah, that would require a lot of changes, but it would be definitely
&lt;br&gt;&amp;gt; great. What does zc.catalog have that zope.catalog doesn't, by the way?
&lt;br&gt;&lt;br&gt;I'm not sure to be honest. There is a whole plethora of options: 
&lt;br&gt;zope.catalog, zc.catalog, repoze.catalog, hurry.query, and possibly 
&lt;br&gt;others as well.
&lt;br&gt;&lt;br&gt;Wichert.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Wichert Akkerman &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26724546&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;wichert@...&lt;/a&gt;&amp;gt; &amp;nbsp; It is simple to make things.
&lt;br&gt;&lt;a href=&quot;http://www.wiggy.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.wiggy.net/&lt;/a&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; It is hard to make things simple.
&lt;br&gt;_______________________________________________
&lt;br&gt;For more information about ZODB, see the ZODB Wiki:
&lt;br&gt;&lt;a href=&quot;http://www.zope.org/Wikis/ZODB/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.zope.org/Wikis/ZODB/&lt;/a&gt;&lt;br&gt;&lt;br&gt;ZODB-Dev mailing list &amp;nbsp;- &amp;nbsp;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26724546&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ZODB-Dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.zope.org/mailman/listinfo/zodb-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.zope.org/mailman/listinfo/zodb-dev&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/cache-size-bytes-usable--tp26246822p26724546.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26724504</id>
	<title>Re: Data.fs size grows non-stop</title>
	<published>2009-12-10T01:48:01Z</published>
	<updated>2009-12-10T01:48:01Z</updated>
	<author>
		<name>Pedro Ferreira-7</name>
	</author>
	<content type="html">&lt;br&gt;&amp;gt; Why not store the events on some BTree or similar structure with a 
&lt;br&gt;&amp;gt; simple unique integer id, and use a separate BTree to map dates to these 
&lt;br&gt;&amp;gt; events? You can even use zc.catalog or similar tools to create that 
&lt;br&gt;&amp;gt; mapping - you would get a lot of query options for free with those as well.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; 
&lt;br&gt;Yeah, that would require a lot of changes, but it would be definitely 
&lt;br&gt;great. What does zc.catalog have that zope.catalog doesn't, by the way?
&lt;br&gt;&lt;br&gt;Pedro
&lt;br&gt;_______________________________________________
&lt;br&gt;For more information about ZODB, see the ZODB Wiki:
&lt;br&gt;&lt;a href=&quot;http://www.zope.org/Wikis/ZODB/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.zope.org/Wikis/ZODB/&lt;/a&gt;&lt;br&gt;&lt;br&gt;ZODB-Dev mailing list &amp;nbsp;- &amp;nbsp;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26724504&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ZODB-Dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.zope.org/mailman/listinfo/zodb-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.zope.org/mailman/listinfo/zodb-dev&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/cache-size-bytes-usable--tp26246822p26724504.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26724075</id>
	<title>Re: Data.fs size grows non-stop</title>
	<published>2009-12-10T01:11:11Z</published>
	<updated>2009-12-10T01:11:11Z</updated>
	<author>
		<name>Pedro Ferreira-7</name>
	</author>
	<content type="html">Thanks!
&lt;br&gt;But I still get an error:
&lt;br&gt;&lt;br&gt;pferreir 
&lt;br&gt;/usr/lib/python2.6/site-packages/ZODB3-3.9.0-py2.6-linux-i686.egg$ 
&lt;br&gt;zodbbrowser ~/indico/db/last.fs
&lt;br&gt;Traceback (most recent call last):
&lt;br&gt;&amp;nbsp; File &amp;quot;/usr/bin/zodbbrowser&amp;quot;, line 8, in &amp;lt;module&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; load_entry_point('zodbbrowser==0.6.1', 'console_scripts', 
&lt;br&gt;'zodbbrowser')()
&lt;br&gt;&amp;nbsp; File 
&lt;br&gt;&amp;quot;/usr/lib/python2.6/site-packages/zodbbrowser-0.6.1-py2.6.egg/zodbbrowser/standalone.py&amp;quot;, 
&lt;br&gt;line 179, in main
&lt;br&gt;&amp;nbsp; &amp;nbsp; configure(options)
&lt;br&gt;&amp;nbsp; File 
&lt;br&gt;&amp;quot;/usr/lib/python2.6/site-packages/zodbbrowser-0.6.1-py2.6.egg/zodbbrowser/standalone.py&amp;quot;, 
&lt;br&gt;line 87, in configure
&lt;br&gt;&amp;nbsp; &amp;nbsp; context = xmlconfig.string(options.site_definition, context=context)
&lt;br&gt;&amp;nbsp; File 
&lt;br&gt;&amp;quot;/usr/lib/python2.6/site-packages/zope.configuration-3.6.0-py2.6.egg/zope/configuration/xmlconfig.py&amp;quot;, 
&lt;br&gt;line 664, in string
&lt;br&gt;&amp;nbsp; &amp;nbsp; processxmlfile(f, context)
&lt;br&gt;&amp;nbsp; File 
&lt;br&gt;&amp;quot;/usr/lib/python2.6/site-packages/zope.configuration-3.6.0-py2.6.egg/zope/configuration/xmlconfig.py&amp;quot;, 
&lt;br&gt;line 378, in processxmlfile
&lt;br&gt;&amp;nbsp; &amp;nbsp; parser.parse(src)
&lt;br&gt;&amp;nbsp; File &amp;quot;/usr/lib/python2.6/xml/sax/expatreader.py&amp;quot;, line 107, in parse
&lt;br&gt;&amp;nbsp; &amp;nbsp; xmlreader.IncrementalParser.parse(self, source)
&lt;br&gt;&amp;nbsp; File &amp;quot;/usr/lib/python2.6/xml/sax/xmlreader.py&amp;quot;, line 123, in parse
&lt;br&gt;&amp;nbsp; &amp;nbsp; self.feed(buffer)
&lt;br&gt;&amp;nbsp; File &amp;quot;/usr/lib/python2.6/xml/sax/expatreader.py&amp;quot;, line 207, in feed
&lt;br&gt;&amp;nbsp; &amp;nbsp; self._parser.Parse(data, isFinal)
&lt;br&gt;&amp;nbsp; File &amp;quot;/usr/lib/python2.6/xml/sax/expatreader.py&amp;quot;, line 349, in 
&lt;br&gt;end_element_ns
&lt;br&gt;&amp;nbsp; &amp;nbsp; self._cont_handler.endElementNS(pair, None)
&lt;br&gt;&amp;nbsp; File 
&lt;br&gt;&amp;quot;/usr/lib/python2.6/site-packages/zope.configuration-3.6.0-py2.6.egg/zope/configuration/xmlconfig.py&amp;quot;, 
&lt;br&gt;line 357, in endElementNS
&lt;br&gt;&amp;nbsp; &amp;nbsp; self.context.end()
&lt;br&gt;&amp;nbsp; File 
&lt;br&gt;&amp;quot;/usr/lib/python2.6/site-packages/zope.configuration-3.6.0-py2.6.egg/zope/configuration/config.py&amp;quot;, 
&lt;br&gt;line 537, in end
&lt;br&gt;&amp;nbsp; &amp;nbsp; self.stack.pop().finish()
&lt;br&gt;&amp;nbsp; File 
&lt;br&gt;&amp;quot;/usr/lib/python2.6/site-packages/zope.configuration-3.6.0-py2.6.egg/zope/configuration/config.py&amp;quot;, 
&lt;br&gt;line 684, in finish
&lt;br&gt;&amp;nbsp; &amp;nbsp; args = toargs(context, *self.argdata)
&lt;br&gt;&amp;nbsp; File 
&lt;br&gt;&amp;quot;/usr/lib/python2.6/site-packages/zope.configuration-3.6.0-py2.6.egg/zope/configuration/config.py&amp;quot;, 
&lt;br&gt;line 1376, in toargs
&lt;br&gt;&amp;nbsp; &amp;nbsp; args[str(name)] = field.fromUnicode(s)
&lt;br&gt;&amp;nbsp; File 
&lt;br&gt;&amp;quot;/usr/lib/python2.6/site-packages/zope.configuration-3.6.0-py2.6.egg/zope/configuration/fields.py&amp;quot;, 
&lt;br&gt;line 141, in fromUnicode
&lt;br&gt;&amp;nbsp; &amp;nbsp; raise schema.ValidationError(v)
&lt;br&gt;zope.configuration.xmlconfig.ZopeXMLConfigurationError: File &amp;quot;&amp;lt;string&amp;gt;&amp;quot;, 
&lt;br&gt;line 4.10-4.72
&lt;br&gt;&amp;nbsp; &amp;nbsp; ConfigurationError: ('Invalid value for', 'package', 'ImportError: 
&lt;br&gt;Module zope.app has no global securitypolicy')
&lt;br&gt;&lt;br&gt;weird...
&lt;br&gt;&lt;br&gt;Marius Gedminas wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Wed, Dec 09, 2009 at 06:09:36PM +0200, Marius Gedminas wrote:
&lt;br&gt;&amp;gt; &amp;nbsp; 
&lt;br&gt;&amp;gt;&amp;gt; On Wed, Dec 09, 2009 at 02:42:58PM +0100, Pedro Ferreira wrote:
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Hello,
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Just zodbbrowser with no prefix:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &lt;a href=&quot;http://pypi.python.org/pypi/zodbbrowser&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://pypi.python.org/pypi/zodbbrowser&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &lt;a href=&quot;https://launchpad.net/zodbbrowser&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://launchpad.net/zodbbrowser&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; It's a web-app: it can connect to your ZEO server so you can inspect the
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; DB while it's being used.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; We tried this, but we currently get an error related with the general 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; security policy for zope.app. Maybe we need to install Zope?
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;gt;&amp;gt; No, it should be self-contained.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; I'm usually testing with the Zope 3.4 KGS.
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I've just released zodbbrowser 0.6.1 which works with ZODB 3.9.x and
&lt;br&gt;&amp;gt; latest versions of other packages too.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; (Supporting both ZODB 3.8 and 3.9 is kinda tricky, but with some very
&lt;br&gt;&amp;gt; ugly hacks I managed.)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Marius Gedminas
&lt;br&gt;&amp;gt; &amp;nbsp; 
&lt;/div&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;For more information about ZODB, see the ZODB Wiki:
&lt;br&gt;&lt;a href=&quot;http://www.zope.org/Wikis/ZODB/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.zope.org/Wikis/ZODB/&lt;/a&gt;&lt;br&gt;&lt;br&gt;ZODB-Dev mailing list &amp;nbsp;- &amp;nbsp;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26724075&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ZODB-Dev@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://mail.zope.org/mailman/listinfo/zodb-dev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://mail.zope.org/mailman/listinfo/zodb-dev&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/cache-size-bytes-usable--tp26246822p26724075.html" />
</entry>

</feed>
