From 18926fb8e01a5332942497d995cfef0f1f2ae3ff Mon Sep 17 00:00:00 2001 From: hns Date: Wed, 23 Oct 2002 15:40:20 +0000 Subject: [PATCH] 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. --- src/helma/objectmodel/db/NodeManager.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/helma/objectmodel/db/NodeManager.java b/src/helma/objectmodel/db/NodeManager.java index 7c33317a..a48d5f54 100644 --- a/src/helma/objectmodel/db/NodeManager.java +++ b/src/helma/objectmodel/db/NodeManager.java @@ -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);