Question

We currently use neo4j in embedded mode, so we start it within our webapplication. With it we also start the standard neo4j console.

We have some event handlers that do certain security checks, so we can never have users that delete that they have to right to. This works, perfectly, but it gets in the way with the console.

If we now want to remove nodes manually (found a bug or something), we cannot delete it from the console, because the event fires.

Is there a way that we use our setup and have the events not fired when the commands come from the neo console? And will this also work for spring-data-neo4j events? We have mixture of both.

Was it helpful?

Solution

kind of hackish approach:

In your tx event handler check for Thread.currentThread().getName(). Depending on your server type (tomcat, jboss, ....) the thread name should be different compared when running a tx via console. Depending on a name pattern the event handler might mute itself for this request.

addendum: I've assumed you speak of TransactionEventHandlers.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top