From de6d9eeccc5f1b7fcc8d53113c6474eea6152225 Mon Sep 17 00:00:00 2001 From: "luca.frosini" Date: Wed, 18 Apr 2018 12:16:09 +0000 Subject: [PATCH] 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 --- .../resourceregistry/context/security/SecurityContext.java | 3 +++ 1 file changed, 3 insertions(+) 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(); }