From d8dc1fc61e1d69672e221ba7f1dc96e58843df2e Mon Sep 17 00:00:00 2001 From: hns Date: Fri, 18 Mar 2005 02:01:41 +0000 Subject: [PATCH] Ignore registerSubnodeChange for transient or new nodes. --- src/helma/objectmodel/db/Node.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/helma/objectmodel/db/Node.java b/src/helma/objectmodel/db/Node.java index 3285bf70..82e0278e 100644 --- a/src/helma/objectmodel/db/Node.java +++ b/src/helma/objectmodel/db/Node.java @@ -314,7 +314,11 @@ public final class Node implements INode, Serializable { * setLastSubnodeChange is called when the transaction completes. */ void registerSubnodeChange() { - if (Thread.currentThread() instanceof Transactor) { + // we do not fetch subnodes for nodes that haven't been persisted yet or are in + // the process of being persistified - except if "manual" subnoderelation is set. + if ((state == TRANSIENT || state == NEW) && subnodeRelation == null) { + return; + } else if (Thread.currentThread() instanceof Transactor) { Transactor tx = (Transactor) Thread.currentThread(); tx.visitParentNode(this); } @@ -558,7 +562,6 @@ public final class Node implements INode, Serializable { */ public Key getKey() { if (state == TRANSIENT) { - Thread.dumpStack(); throw new RuntimeException("getKey called on transient Node: " + this); }