Fixed problem related with the thread, file locked problems with the neo4j database, basically I decided, once the transaction is done, apply a graphDb.shutdown() method directly.