[ZODB-Dev] Packless and copyTransactionsFrom()????

Jim Fulton jim@zope.com
Mon, 20 Aug 2001 17:42:10 -0400


Christian Robottom Reis wrote:
> 
> On Mon, 20 Aug 2001, John D. Heintz wrote:
> 
> > Is export/import the only reason not to use them?
> 
> I think Jim wants to imply they're an "implementation detail" [and that
> they might "go away" in other versions, too] :)

No, I don't expect _p_oid to go away. It's just that they 
belong to the database and the database could decide to do things
with them that would break your application. Export/import is a current
case, but there may be other cases in thr future.

Another way to look at this is that using _p_oids for application-meaningful
purposes is like using application-meaningful data for primary keys in relational
databases.

> > Back before I understood BTrees I assumed that the only scalable way to add
> > millions of objects that I could then look up by ID was to use the database
> > generated IDs.  A little Oracle sequence dain bramage showing though.
> 
> But with a BTree you can use your own integers as indexes, so
> there's really no point, right?

You can always generate your own ids, independent of BTrees.  The Zope catalog
assigns Ids (pseudo)randomly then checks to make sure they aren't already used. The
overall database consistency allows this to work in a multi-threaded/multi-process 
environment.

Jim

--
Jim Fulton           mailto:jim@zope.com       Python Powered!        
Technical Director   (888) 344-4332            http://www.python.org  
Zope Corporation     http://www.zope.com       http://www.zope.org