protected UserTransaction locateUserTransaction() {
return new UserTransactionImpl( neo4jDb() );
}
private GraphDatabaseAPI neo4jDb() {
ServiceRegistry serviceRegistry = serviceRegistry();
serviceRegistry = serviceRegistry
.getService( SessionFactoryServiceRegistryFactory.class )
.buildServiceRegistry( (SessionFactoryImplementor) null, (Configuration) null );
Neo4jDatastoreProvider service = (Neo4jDatastoreProvider) serviceRegistry.getService( DatastoreProvider.class );
return (GraphDatabaseAPI) service.getDataBase();
}