neo4j/enterprise — pull request #64 by jakewins (2012-08-17 14:32:22+00:00)
Title: Race condition in internalShutdown 

This fixes an issue where the protection from accessing internal databases during eg. a master switch or similar did not kick in until after the internal database was shut down.

To do this in a single-threaded and stable way, I've introduced a public DependencyResolver in HighlyAvailableGraphDatabase, through which the internal databases can be accessed. This allows, in turn, hooking into the lifecycle of the internal database and doing the kind of poking required.

Using the DependencyResolver is, I think, a more elegant approach than all the getXX dependency-methods we have in GraphDatabaseAPI, and I'd quite like it if we could move to a single getDependencyResolver() instead.

That would also make it easer to find code that pulls dependencies rather than injects it, allowing us to modify that code.