[ZODB-Dev] zodb4: adding an object before transaction commit

Christian Robottom Reis kiko at async.com.br
Tue Oct 7 09:12:15 EDT 2003


On Tue, Oct 07, 2003 at 09:38:12AM +0200, Roché Compaan wrote:
> * John Belmonte <jvb at prairienet.org> [2003-10-06 19:37]:
> > Steve Alexander wrote:
> > >I want to do some things with the oids of persistent objects, such as 
> > >use them as keys in a BTree.
> > >
> > >The thing is that an object doesn't get an oid until it is added to the 
> > >database, and a transaction is committed.
> > 
> > Hello,
> > 
> > I'm wondering if your need can be addressed by the "ID generator" patch 
> > posted by Roché Compaan (see 
> > http://mail.zope.org/pipermail/zodb-dev/2003-August/005690.html).  I 
> > think it is a more general solution.
> > 
> > I would like to see some form of Roché's idea put into ZODB proper, and 
> > would be willing to help with the maintenance, documentation, and testing.
> 
> FYI, that patch has 2 issues - first, counters are not persisted so they
> get lost after a restart and second, TmpStore is not patched. But at
> least it shows the idea.

As for the first problem, have you tried storing the counter as a key in
the ZODB root? It should work 

> If anyone is interested I made a small FileStorage123 package with the
> id generator functionality that doesn't patch any ZODB code - I only
> subclass and extend File-, Server- and ClienStorage.

Sounds interesting, where's the code? :-)

Take care,
--
Christian Robottom Reis | http://async.com.br/~kiko/ | [+55 16] 261 2331



More information about the ZODB-Dev mailing list