Database Reference
In-Depth Information
Listing 10.3. Starting and stopping an embedded graph database
It's important to try to ensure Neo4j shuts down cleanly whenever your application exits.
The shutdown code in listing 10.3 will be triggered even if you send a SIGINT (Ctrl-
C) signal to try to terminate the process before it's finished.
Failure to shut down cleanly could result in problems the next time you start up. Neo4j is
able to detect unclean shutdowns and attempt a recovery, but this will result in a slower
initial startup while the recovery is in process, and sometimes may result in other issues as
well. When an unclean shutdown occurs, the following warning message can generally be
seen in the logs the next time the database is started up again: non clean shutdown
detected .
Testing in embedded mode
Testing forms an important part of any software development project. This topic and most
of the code detailed within are backed by unit tests proving and illustrating the scenari-
os and statements made in various chapters. In many cases, these tests make use of a
very handy in-memory database implementation ( org.neo4j.test.Impermanent-
GraphDatabase ) that has specifically been created with unit testing in mind.
 
Search WWH ::




Custom Search