Author: michiel Date: 2010-03-23 11:34:47 +0100 (Tue, 23 Mar 2010) New Revision: 41570
Modified: mmbase/trunk/core/src/main/java/org/mmbase/bridge/implementation/BasicRelation.java Log: setSource, setDestination obviosly need checkWrite. It's especially important because that method also arranges the temporarynode-manager stuff Modified: mmbase/trunk/core/src/main/java/org/mmbase/bridge/implementation/BasicRelation.java =================================================================== --- mmbase/trunk/core/src/main/java/org/mmbase/bridge/implementation/BasicRelation.java 2010-03-23 10:32:27 UTC (rev 41569) +++ mmbase/trunk/core/src/main/java/org/mmbase/bridge/implementation/BasicRelation.java 2010-03-23 10:34:47 UTC (rev 41570) @@ -95,6 +95,7 @@ } public void setSource(Node node) { + checkWrite(); if (node.getCloud() != cloud) { throw new BridgeException("Source and relation are not in the same transaction or from different clouds."); } @@ -104,13 +105,15 @@ // set a temporary field, transactionmanager resolves this getNode().setValue("_snumber", node.getValue(MMObjectBuilder.TMP_FIELD_NUMBER)); } else { - getNode().setValue("snumber",source); + getNode().setValue("snumber", source); + assert source == node.getNumber(); } snum = node.getNumber(); sourceNodeType = node.getIntValue("otype"); } public void setDestination(Node node) { + checkWrite(); if (node.getCloud() != cloud) { throw new BridgeException("Destination and relation are not in the same transaction or from different clouds."); } @@ -234,8 +237,11 @@ } } } + //assert snum == getNode().getIntValue("snumber"); + //log.debug("COMMITTING relation with snumber " + snum + " -> " + dnum + " (" + getNode() + ")"); super.commit(); if (!(cloud instanceof Transaction)) { + //assert snum == getNode().getIntValue("snumber"); snum = getNode().getIntValue("snumber"); dnum = getNode().getIntValue("dnumber"); } _______________________________________________ Cvs mailing list Cvs@lists.mmbase.org http://lists.mmbase.org/mailman/listinfo/cvs