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,14 +271,16 @@ 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
} else if (!rel.virtual && !rel.usesPrimaryKey ()) {
// apply different consistency checks for groupby nodes and database nodes:
// for group nodes, check if they're contained
} else if (rel.groupby != null) {
if (rel.groupby != null) {
if (home.contains (node) < 0)
node = null;
// for database nodes, check if constraints are fulfilled
@ -286,6 +288,7 @@ public final class NodeManager {
node = null;
}
}
}
if (node == null || node.getState() == Node.INVALID) {