Hi,

While working with MMBase transactions (MMBase 1.6.3), I found
two bugs that make it impossible to remove related objects. I
post these on the list because I do not have access to the
BugTracker system. The first is a more severe version of closed
bug 216, the second is not yet in BugTracker. Sorry if this
mail is a bit long.

Bug 1:
It is impossible to remove related nodes inside a transaction
in some cases. Suppose:
   A -> B -> C -> D and
        B -> E.

A, B and C are of type org.mmbase.bridge.Node. Goal is to remove
B and C including their relations and not A, D and E inside a
transaction. Nodes D and E may be images that are used in other
relations. The following will not work:

   C.remove(true);
   B.remove(true);

Reason for this is that if C is removed with relations,
the relations from C are added to the transaction first
(BasicNode:575) and are then flagged for deletion
(BasicNode:576). If B is then removed with relations, an
attempt is made to add the relation from B to C again to
the transaction, which fails, bacause it's already present
(TransactionManager:81).

Bug 2:
To solve the problem above, as also suggested in bug 216, one
might attempt to first delete the relations AB, BC, CD and BE.
This will not work inside a transaction. Deleting the relations
works fine, but calling e.g. 'B.delete(false);' fails. In
BasicNode:505 the core is asked whether B has any relations.
It still has, because the relations are deleted inside a
transaction and not yet physically removed.


Regards,
Ronald Wildenberg


-------------------------------------
Ronald Wildenberg
Finalist IT Group / Java Specialists
P.O. Box 1354
3000 BJ Rotterdam
The Netherlands                 
Office: +31 20 596 2311
Fax: +31 20 596 2331
[EMAIL PROTECTED]
http://www.finalist.com
-------------------------------------

Reply via email to