Improved check if cached NullNode is still valid.

This commit is contained in:
hns 2002-10-01 15:52:22 +00:00
parent e6de4746d9
commit e01c244d40

View file

@ -271,19 +271,22 @@ public final class NodeManager {
// check if we can use the cached node without further checks. // 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. // 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) // check if node is null node (cached null)
if (node.isNullNode ()) { 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 node = null; // cached null not valid anymore
// apply different consistency checks for groupby nodes and database nodes: } else if (!rel.virtual && !rel.usesPrimaryKey ()) {
// for group nodes, check if they're contained // apply different consistency checks for groupby nodes and database nodes:
} else if (rel.groupby != null) { // for group nodes, check if they're contained
if (home.contains (node) < 0) 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; node = null;
// for database nodes, check if constraints are fulfilled }
} else if (!rel.checkConstraints (home, node)) {
node = null;
} }
} }