Reverse sequence of <get-from-nodemgr> and <get-from-propmap> in

getProperty(). This may return old cached properties from the propmap when it
shouldn't, but it fixes the much worse bug where embedded-db-collections are
created from scratch again and again.
This commit is contained in:
hns 2003-11-21 10:59:10 +00:00
parent 76abbbdddc
commit babe14b16f

View file

@ -1618,24 +1618,7 @@ public final class Node implements INode, Serializable {
null : null :
dbmap.getExactPropertyRelation(propname); dbmap.getExactPropertyRelation(propname);
// 1) check if this is a create-on-demand node property // 1) check if the property is contained in the propMap
if (rel != null && (rel.isVirtual() || rel.isComplexReference())) {
if (state != TRANSIENT) {
Node n = nmgr.getNode(this, propname, rel);
if (n != null) {
if ((n.parentHandle == null) &&
!"root".equalsIgnoreCase(n.getPrototype())) {
n.setParent(this);
n.name = propname;
n.anonymous = false;
}
return new Property(propname, this, n);
}
}
}
// 2) check if the property is contained in the propMap
Property prop = propMap == null ? null : Property prop = propMap == null ? null :
(Property) propMap.get(propname.toLowerCase()); (Property) propMap.get(propname.toLowerCase());
@ -1672,6 +1655,24 @@ public final class Node implements INode, Serializable {
return (Property) propMap.get(propname.toLowerCase()); return (Property) propMap.get(propname.toLowerCase());
} }
// 2) check if this is a create-on-demand node property
if (rel != null && (rel.isVirtual() || rel.isComplexReference())) {
if (state != TRANSIENT) {
Node n = nmgr.getNode(this, propname, rel);
if (n != null) {
if ((n.parentHandle == null) &&
!"root".equalsIgnoreCase(n.getPrototype())) {
n.setParent(this);
n.name = propname;
n.anonymous = false;
}
return new Property(propname, this, n);
}
}
}
// 3) try to get the property from the database via accessname, if defined // 3) try to get the property from the database via accessname, if defined
if (rel == null && dbmap != null && state != TRANSIENT) { if (rel == null && dbmap != null && state != TRANSIENT) {
rel = dbmap.getSubnodeRelation(); rel = dbmap.getSubnodeRelation();