Ignore registerSubnodeChange for transient or new nodes.
This commit is contained in:
parent
e72037c35f
commit
d8dc1fc61e
1 changed files with 5 additions and 2 deletions
|
@ -314,7 +314,11 @@ public final class Node implements INode, Serializable {
|
||||||
* setLastSubnodeChange is called when the transaction completes.
|
* setLastSubnodeChange is called when the transaction completes.
|
||||||
*/
|
*/
|
||||||
void registerSubnodeChange() {
|
void registerSubnodeChange() {
|
||||||
if (Thread.currentThread() instanceof Transactor) {
|
// we do not fetch subnodes for nodes that haven't been persisted yet or are in
|
||||||
|
// the process of being persistified - except if "manual" subnoderelation is set.
|
||||||
|
if ((state == TRANSIENT || state == NEW) && subnodeRelation == null) {
|
||||||
|
return;
|
||||||
|
} else if (Thread.currentThread() instanceof Transactor) {
|
||||||
Transactor tx = (Transactor) Thread.currentThread();
|
Transactor tx = (Transactor) Thread.currentThread();
|
||||||
tx.visitParentNode(this);
|
tx.visitParentNode(this);
|
||||||
}
|
}
|
||||||
|
@ -558,7 +562,6 @@ public final class Node implements INode, Serializable {
|
||||||
*/
|
*/
|
||||||
public Key getKey() {
|
public Key getKey() {
|
||||||
if (state == TRANSIENT) {
|
if (state == TRANSIENT) {
|
||||||
Thread.dumpStack();
|
|
||||||
throw new RuntimeException("getKey called on transient Node: " + this);
|
throw new RuntimeException("getKey called on transient Node: " + this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue