diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/utils/Utility.java b/src/main/java/org/gcube/informationsystem/resourceregistry/utils/Utility.java index 6156461..c5d65be 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/utils/Utility.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/utils/Utility.java @@ -30,14 +30,12 @@ import com.tinkerpop.blueprints.Element; import com.tinkerpop.blueprints.Vertex; import com.tinkerpop.blueprints.impls.orient.OrientBaseGraph; import com.tinkerpop.blueprints.impls.orient.OrientElement; -import com.tinkerpop.blueprints.impls.orient.OrientGraphFactory; import com.tinkerpop.blueprints.impls.orient.OrientGraphNoTx; import com.tinkerpop.blueprints.util.io.graphson.GraphSONMode; import com.tinkerpop.blueprints.util.io.graphson.GraphSONUtility; /** * @author Luca Frosini (ISTI - CNR) - * */ public class Utility { @@ -92,17 +90,11 @@ public class Utility { public static El getElementByUUIDAsAdmin(String elementType, UUID uuid, Class clz) throws ERNotFoundException, ResourceRegistryException { - - OrientGraphFactory orientGraphFactory = SecurityContextMapper - .getSecurityContextFactory(SecurityContextMapper.ADMIN_SECURITY_CONTEXT_UUID, PermissionMode.READER); - OrientGraphNoTx orientGraphNoTx = null; try { - - orientGraphNoTx = orientGraphFactory.getNoTx(); - + orientGraphNoTx = SecurityContextMapper.getSecurityContextGraphNoTx( + SecurityContextMapper.ADMIN_SECURITY_CONTEXT_UUID, PermissionMode.READER); return Utility.getElementByUUID(orientGraphNoTx, elementType, uuid, clz); - } finally { if (orientGraphNoTx != null) { orientGraphNoTx.shutdown();