Node.getNonVirtualParent doesn't work correctly for transient nodes, so add
a try-catch when setting the back-reference in Relation.setConstraints() since it may fail.
This commit is contained in:
parent
3101e32ad3
commit
c6e5dcbc95
1 changed files with 4 additions and 1 deletions
|
@ -1044,8 +1044,11 @@ public final class Relation {
|
||||||
if ((currentValue == null) ||
|
if ((currentValue == null) ||
|
||||||
((currentValue != home) &&
|
((currentValue != home) &&
|
||||||
((currentValue.getState() == Node.TRANSIENT) ||
|
((currentValue.getState() == Node.TRANSIENT) ||
|
||||||
(home.getState() != Node.TRANSIENT)))) {
|
(home.getState() != Node.TRANSIENT)))) try {
|
||||||
child.setNode(crel.propName, home);
|
child.setNode(crel.propName, home);
|
||||||
|
} catch (Exception ignore) {
|
||||||
|
// in some cases, getNonVirtualParent() doesn't work
|
||||||
|
// correctly for transient nodes, so this may fail.
|
||||||
}
|
}
|
||||||
} else if (crel.reftype == PRIMITIVE) {
|
} else if (crel.reftype == PRIMITIVE) {
|
||||||
child.setString(crel.propName, home.getID());
|
child.setString(crel.propName, home.getID());
|
||||||
|
|
Loading…
Add table
Reference in a new issue