[Zope-Coders] Zope test results
Shane Hathaway
shane@zope.com
Wed, 12 Jun 2002 09:44:50 -0400
Chris McDonough wrote:
> I'm not sure whether ObjectManager should be fixed or ZODB that should
> be fixed or both. I didn't dig too much into the rationale for setting
> up the subobject's _p_jar immediately, does anybody have a good handle
> on how this helps the copy machinery?
I'd talk to you directly but I may as well let others know who are
interested. ;-) There are certain times when you'd like to create an
object and, within the same transaction, make a copy of it.
Unfortunately, it doesn't work if _p_jar isn't set. So I added that
little hack many moons ago.
But I think I know the right solution now: commit a subtransaction just
before copying. The _p_jar (and _p_oid) of all new objects will be set.
It should be perfectly safe since copying involves a subtransaction
anyway, so now we'll just be using two subtransactions instead of one.
I'll work on it.
Shane