Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
12-22-2018 02:38 PM
I am using neo4j java client. When a write query is successful, I know it is possible to know how many nodes have been created, updated or deleted, and same for relationships via SummaryCounters. However, is there a way to know exactly which nodes and relationships have been created/updated/deleted ?
Thx.
12-24-2018 03:31 AM
You could use a serverside TransactionEventHandler
. In it's afterCommit
method you get a callback with exactly that information.
APOC Triggers (https://neo4j-contrib.github.io/neo4j-apoc-procedures/#_triggers) leverage exactly that functionality.
12-24-2018 03:42 AM
As far as I know, TransactionEventHandler is not available in neo4j-java-driver. I have to add neo4j-graph-api dependency. Is it correct ?
12-24-2018 04:43 AM
TransactionEventHandlers are a server-side concept - so that code should be a separate module from your client -side part.
See https://maxdemarzi.com/2015/03/25/triggers-in-neo4j/ for an example.
All the sessions of the conference are now available online