Improved check if cached NullNode is still valid.
This commit is contained in:
parent
e6de4746d9
commit
e01c244d40
1 changed files with 12 additions and 9 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue