[ZODB-Dev] undo and zodb

Toby Dickenson tdickenson@geminidataloggers.com
Tue, 3 Sep 2002 17:04:47 +0100


On Tuesday 03 Sep 2002 4:43 pm, Jeremy Hylton wrote:

> I don't think you need to worry about this problem being exacerbated
> by conflict resolution.  CR only deals with the state of a single
> object.  That object must exist in the database, or its CR method
> would not have been called.

consider this scenario:

1. object A has a reference to object B
2. two transactions start
3. the first transaction modifies A by deleting the reference to B,
   and commits.
4. the second transaction modifies A in a different way
5. a conflict in A is detected when committing the second transaction
6. the conflict resolution method is given three states. The original,
   the state committed by the first transaction in step 1, and the=20
   state created by the second transaction in step 4. It returns a new
   state which does include the reference to object B.


=46rom the storage point of view, object B is unreferenced between steps =
3 and=20
6. It could be removed by packing.

Jim argues that this conflict resolution method is broken, because it ign=
ores=20
the change made by the first transaction. Im not sure this will prove to =
be=20
true in all cases.



>  The CR method can't create dangling
> references; it executes as a sub-part of an existing transaction and
> it only has full access to a single object.  The worst it can do is
> remove the final reference to an object, causing the object to be
> deleted at the end of the transaction.

The CR method has a different role in the problem scenario; it revives th=
e=20
once-unreferenced object.