Neo4j - database shutdown

159 views Asked by At

I am using Neo4j embedded in my Scala project. I have been including

ShutdownHookThread {
    shutdown(ds)
    }

the above piece of code in each and every function before the beginning of transaction. Do I need to include it in every function. What happens if I don't include it?

1

There are 1 answers

4
Yaroslav On

ShutdownHookThread registers a piece of code to be executed when your application is about to exit. You need to use it only once - somewhere in your app bootstrap code, cause there is no sense to shutdown the database more than one time.