<br><br><div class="gmail_quote">On Thu, Aug 6, 2009 at 9:28 AM, Gustavo Rahal <span dir="ltr">&lt;<a href="mailto:grahal@linux.vnet.ibm.com">grahal@linux.vnet.ibm.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Em Ter, 2009-08-04 ąs 06:28 -0400, Jim Fulton escreveu:<br>
<div class="im">&gt; On Mon, Aug 3, 2009 at 9:09 PM, Gary Poster&lt;<a href="mailto:gary.poster@gmail.com">gary.poster@gmail.com</a>&gt; wrote:<br>
&gt; &gt;<br>
&gt; &gt; On Aug 3, 2009, at 3:00 PM, Gustavo Rahal wrote:<br>
&gt; ...<br>
&gt; &gt; Practically, using the BTrees that the ZODB provides will typically<br>
&gt; &gt; have the behavior you want for the first and third gotcha.  For the<br>
&gt; &gt; second gotcha, we typically give each connection to the ZODB its own<br>
&gt; &gt; random starting point stored on a volatile (disposable) attribute for<br>
&gt; &gt; the index, and each connection increments that point.  Look at the<br>
&gt; &gt; code in zope.intid, for instance: _generateId in <a href="http://svn.zope.org/zope.intid/trunk/src/zope/intid/__init__.py?rev=100049&amp;view=auto" target="_blank">http://svn.zope.org/zope.intid/trunk/src/zope/intid/__init__.py?rev=100049&amp;view=auto</a><br>

&gt;<br>
&gt;<br>
&gt; Gustavo,<br>
&gt;<br>
&gt; Note that a simpler variation on this is to assign the values<br>
&gt; randomly.  Assigning them sequentially from a random starting point is<br>
&gt; an optimization to reduce the number of BTree nodes read and updated<br>
&gt; by a particular client.<br>
&gt;<br>
&gt; Jim<br>
&gt;<br>
<br>
</div>Thanks for the responses. I realized that I&#39;m mixing Zope3 with ZODB. So<br>
I should have asked if Zope3 offers anything in the uniqueness direction<br>
and I found out that apparently it does. Anyway, it was good to know how<br>
to deal with uniqueness in ZODB &quot;standalone&quot;<br>
<br>
pg 61 of Zope3 Web Component Architecture<br>
<br>
Schema field parameters<br>
<br>
&quot;unique -&gt; Specifies whether the values in a collection must be unique<br>
or not. Applicable to all collection fields (including sequence fields)&quot;<br>
<br>
I guess that is what I wanted correct?<br>
<div class="im"></div></blockquote><div><br></div><div>depends on what your looking for. if your looking for a value to be within a collection on a single persistent object, you can utilize this, but at a cost of write concurrency, as it creates a chokepoint for multiple writers. for multiple persistent objects in the object database you&#39;ll need something additional. gary&#39;s reply gives a more technical understanding of the solutions. another simple solution is to use the unique value as the object&#39;s key within its container.</div>
<div><br></div><div>cheers,</div><div><br></div><div>kapil</div><div><br></div></div>