From e01c244d40c00c4db8f029d2049fd80bcc417fbb Mon Sep 17 00:00:00 2001 From: hns Date: Tue, 1 Oct 2002 15:52:22 +0000 Subject: [PATCH] Improved check if cached NullNode is still valid. --- src/helma/objectmodel/db/NodeManager.java | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/helma/objectmodel/db/NodeManager.java b/src/helma/objectmodel/db/NodeManager.java index 874c79d1..7c33317a 100644 --- a/src/helma/objectmodel/db/NodeManager.java +++ b/src/helma/objectmodel/db/NodeManager.java @@ -271,19 +271,22 @@ public final class NodeManager { // check if we can use the cached node without further checks. // we need further checks for subnodes fetched by name if the subnodes were changed. - if (node != null && node.getState() != Node.INVALID && !rel.virtual && !rel.usesPrimaryKey ()) { + if (node != null && node.getState() != Node.INVALID) { // check if node is null node (cached null) if (node.isNullNode ()) { - if (node.created() < rel.otherType.getLastDataChange ()) + if (node.created() < rel.otherType.getLastDataChange () || + node.created() < rel.ownType.getLastTypeChange()) node = null; // cached null not valid anymore - // apply different consistency checks for groupby nodes and database nodes: - // for group nodes, check if they're contained - } else if (rel.groupby != null) { - if (home.contains (node) < 0) + } else if (!rel.virtual && !rel.usesPrimaryKey ()) { + // apply different consistency checks for groupby nodes and database nodes: + // for group nodes, check if they're contained + if (rel.groupby != null) { + if (home.contains (node) < 0) + node = null; + // for database nodes, check if constraints are fulfilled + } else if (!rel.checkConstraints (home, node)) { node = null; - // for database nodes, check if constraints are fulfilled - } else if (!rel.checkConstraints (home, node)) { - node = null; + } } }