Closing factory before creating a new one

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/information-system/resource-registry@167105 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Luca Frosini 2018-04-18 12:16:09 +00:00
parent b95374b6c0
commit de6d9eeccc
1 changed files with 3 additions and 0 deletions

View File

@ -514,6 +514,7 @@ public class SecurityContext {
OrientGraphFactory factory = getFactory(permissionMode, false);
OrientGraph orientGraph = factory.getTx();
if(orientGraph.isClosed()) {
factory.close();
factory = getFactory(permissionMode, true);
orientGraph = factory.getTx();
}
@ -524,6 +525,7 @@ public class SecurityContext {
OrientGraphFactory factory = getFactory(permissionMode, false);
OrientGraphNoTx orientGraphNoTx = factory.getNoTx();
if(orientGraphNoTx.isClosed()) {
factory.close();
factory = getFactory(permissionMode, true);
orientGraphNoTx = factory.getNoTx();
}
@ -534,6 +536,7 @@ public class SecurityContext {
OrientGraphFactory factory = getFactory(permissionMode, false);
ODatabaseDocumentTx databaseDocumentTx = factory.getDatabase();
if(databaseDocumentTx.isClosed()) {
factory.close();
factory = getFactory(permissionMode, true);
databaseDocumentTx = factory.getDatabase();
}