When a node accessed by secondary keys (accessname) is fetched but then found

by primary key in the cache, reset its create time to its lastmod time. Otherwise,
Relation.checkConstraints will (rightly) reject it if a filter is defined for it, since it
can't be sure that the filter constraint is still valid for the modified node.
This commit is contained in:
hns 2002-10-23 15:40:20 +00:00
parent 4b945e9d72
commit 18926fb8e0

View file

@ -305,6 +305,9 @@ public final class NodeManager {
Node oldnode = (Node) cache.put (primKey, node);
// no need to check for oldnode != node because we fetched a new node from db
if (oldnode != null && !oldnode.isNullNode() && oldnode.getState () != Node.INVALID) {
// reset create time of old node, otherwise Relation.checkConstraints
// will reject it under certain circumstances.
oldnode.created = oldnode.lastmodified;
cache.put (primKey, oldnode);
if (!keyIsPrimary) {
cache.put (key, oldnode);