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

Shane Hathaway shane at zope.com
Mon Oct 6 11:46:33 EDT 2003


Steve Alexander wrote:
> I'd like a way of saying to a data manager (_p_jar) that I intend to add 
> an object to the database, so the data manager can provide that object 
> with a suitable _p_jar and _p_oid. The oid would remain as set if the 
> object is attached to the database's root object (possibly via other 
> objects), and a transaction comimtted.

FWIW, here is the way we do this in ZODB 3:

f._p_jar = root_object._p_jar
get_transaction().commit(1)

The object "f" receives a _p_oid during subtransaction commit.  A 
documented API would be better.

Shane




More information about the ZODB-Dev mailing list