From 0f77c3461b46e1efd15ae7c8b900bc8b558a5aa7 Mon Sep 17 00:00:00 2001 From: hns Date: Wed, 3 Dec 2003 11:58:36 +0000 Subject: [PATCH] Do not issue a getNodeByKey() if we get a node by relation, just because it's not a complex reference or create-one-demand relation! This was introduced because we assumed that the calling code would know what it was doing, i.e. only call this for objects contained in its subnode index, but as it seems to turn out it didn't, and this isn't really necessary after all. --- src/helma/objectmodel/db/NodeManager.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/helma/objectmodel/db/NodeManager.java b/src/helma/objectmodel/db/NodeManager.java index a1921d98..89d9356a 100644 --- a/src/helma/objectmodel/db/NodeManager.java +++ b/src/helma/objectmodel/db/NodeManager.java @@ -202,14 +202,10 @@ public final class NodeManager { public Node getNode(Key key) throws Exception { Transactor tx = (Transactor) Thread.currentThread(); - // tx.timer.beginEvent ("getNode "+kstr); - // it would be a good idea to reuse key objects one day. - // Key key = new Key (dbmap, kstr); // See if Transactor has already come across this node Node node = tx.getVisitedNode(key); if ((node != null) && (node.getState() != Node.INVALID)) { - // tx.timer.endEvent ("getNode "+kstr); return node; } @@ -241,7 +237,7 @@ public final class NodeManager { cache.put(node.getKey(), oldnode); node = oldnode; } - } + } // end of cache-synchronized section } } @@ -279,9 +275,9 @@ public final class NodeManager { // generated on the fly key = new SyntheticKey(home.getKey(), kstr); } else { - // refers to a node through its primary database key - key = new DbKey(rel.otherType, kstr); - return getNode(key); + // Not a relation we use can use getNodeByRelation() for + System.err.println(" WOMBAT: "+home+" ° "+kstr); + return null; } // See if Transactor has already come across this node