We have an implementation of TransactionEventHandler<Neo4JTransaction>

in the method beforeCommit() I would like to use getProperty("nodeType") ..
so I can take proper action.
Now in the case of a deletion event, it won't let me call it and throws an
exception.

I'm surprised by this exception has this is beforeCommit() and the node is
not delete YET.

public Neo4JTransaction beforeCommit(TransactionData data) throws Exception
{
        for (Node deletedNode : data.deletedNodes()) {
                boolean b = deletedNode.hasproperty("type") // Fails with 
Exception
        }
}

Caused by: java.lang.IllegalStateException: Node[9] has been deleted in this
tx
        at
org.neo4j.kernel.impl.core.LockReleaser.getCowPropertyRemoveMap(LockReleaser.java:450)
        at
org.neo4j.kernel.impl.core.NodeManager.getCowPropertyRemoveMap(NodeManager.java:991)
        at org.neo4j.kernel.impl.core.Primitive.hasProperty(Primitive.java:278)
        at org.neo4j.kernel.impl.core.NodeProxy.hasProperty(NodeProxy.java:150)

Is this expected / a bug ?

Any alternatives ?

Thanks.

--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/getProperty-on-deleted-Node-in-TransactionEventHandler-beforeCommit-tp3320791p3320791.html
Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
_______________________________________________
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to