neo4j/neo4j — pull request #2159 by benbc (2014-03-24 10:54:28+00:00)
Title: Don't access resources during shutdown.

The XaDataSourceManager was creating new resources in
unregisterDataSource(). When this method is called during shutdown,
other components may already have been shut down so the resource
creation may fail.

The particular case we saw was a race condition shutting down during a
master switch, which caused a NullPointerException in
XaConnectionHelperImpl when LuceneDataSource tried to create a
LuceneXaResource with a null XaResourceManager (which had been nulled
out during the master switch).