diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/context/security/SecurityContext.java b/src/main/java/org/gcube/informationsystem/resourceregistry/context/security/SecurityContext.java index 1381099..96106f0 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/context/security/SecurityContext.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/context/security/SecurityContext.java @@ -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(); }