Skip to content

ikwattro/neo4j-transaction-event-listener-extension

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Neo4j Transaction Event Listener Extension example code

Build this extension

mvn clean package

Install the plugin

Copy the jar into the /plugins directory of your Neo4j server

copy target/*.jar <NEO4J_HOME>/plugins

Restart Neo4j

./bin/neo4j restart

Test

This plugin will add some attribute to every create node

CREATE (n:Person {name: "Chris"})

Then check the data :

MATCH (n:Person)
RETURN n{.*}

//Result
╒═══════════════════════════════════════════════╕
│"n"                                            │
╞═══════════════════════════════════════════════╡
│{"name":"Chris","setByTxListener":"some value"}│
└───────────────────────────────────────────────┘

A line is also logged during the afterCommit phase

2022-01-15 17:09:19.814+0000 INFO  [neo4j/3bfca502] Logging after commit on transaction with ID 7

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages