[Grok-dev] ZODB and storing, retrieving, deleting, use of ID

Christian Theune ct at gocept.com
Sat Oct 18 10:50:48 EDT 2008

On Fri, 2008-10-10 at 20:15 -0700, Kevin Teague wrote:
> When doing autogeneration of primary keys in a relational database,
> there is usually a separate Sequence object which tracks the value of
> the next id to use, when a new record is inserted the Sequence object
> is updated by one. It's possible to implement this directly in Grok,
> but Laurences suggestions of randomised keys for efficiency may be
> preferable.

Those Sequences work differently in a way that the ZODB doesn't support.
They are implemented in a manner that allows them to look "around"
transactions to retrieve a globally unique value with little conflicts
but consistency. ZODB doesn't support that. Either you can create a
perfect serial (but get conflicts), resolve the conflicts (and get
broken serials) or use a non-serial approach (like randomization).


Christian Theune · ct at gocept.com
gocept gmbh & co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 7 · fax +49 345 1229889 1
Zope and Plone consulting and development
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : http://mail.zope.org/pipermail/grok-dev/attachments/20081018/f2183273/attachment.bin 

More information about the Grok-dev mailing list