[ZODB-Dev] [ZODB4] - Shouldn't the new object be added to Connection._created ?

Ury Marshak um@hottech-israel.com
Mon, 8 Jul 2002 16:24:48 +0200


----- Original Message ----- From: "Jim Fulton" <jim@zope.com>


> No, the object will be added to the created list in commit_store,
> where the stack is processed,

Well, unfortunately this is not what happens to me under ZEO.
Scenario: a new object is inserted in existing persistent container,
container gets pickled, persistent_id()  is called, the new object gets
assigned oid. Transaction fails. The new object still has oid and the works.
We retry the transaction (or even access any attribute on the object).
The persistent machinery sees the object with _p_state==3, ghost,
tries to unghostify it using a [non-existent] oid -- BOOM..


>
> Note that, if the transaction is aborted, the reference to the new object
> will go away and it will disappear, so it doesn't really need to be
> invalidated. You don't need to keep track of created objects until they
> have been assigned oids.
The point is that under ZEO the whole thing seems to take slightly
different paths (tpc_abort etc)  than when using for example FileStorage
directly.
Could it be that ZEO assignes oids to all new objects in the transaction
and only then sends the whole transaction to the server, while the
local storage is able to detect a conflict early and simply does not get
to the point of assigning oids..
(Is it supposed to work under CVS-ZEO at all, or is ZEO scheduled for
a rewrite or something?)

Ury