]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/SessionImplDb.java
Direct and synchronization-free access to Layer0 resource class for DB
[simantics/platform.git] / bundles / org.simantics.db.procore / src / fi / vtt / simantics / procore / internal / SessionImplDb.java
index 92c5e9dda255a93b19ffeb21954a2c4153c7c674..0178e805fd29d09b99cce3ecc5ff7d8a4b3e8fec 100644 (file)
@@ -18,7 +18,6 @@ import org.simantics.db.SessionManager;
 import org.simantics.db.SessionReference;
 import org.simantics.db.VirtualGraph;
 import org.simantics.db.authentication.UserAuthenticationAgent;
-import org.simantics.db.common.utils.Logger;
 import org.simantics.db.exception.DatabaseException;
 import org.simantics.db.exception.InvalidAuthenticationException;
 import org.simantics.db.exception.InvalidUserException;
@@ -30,9 +29,13 @@ import org.simantics.db.impl.graph.WriteSupport;
 import org.simantics.db.impl.query.QueryProcessor;
 import org.simantics.db.impl.query.QuerySupport;
 import org.simantics.db.service.ServerInformation;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 final public class SessionImplDb extends SessionImplSocket {
 
+    private static final Logger LOGGER = LoggerFactory.getLogger(SessionImplDb.class);
+
     /**
      * Cached ServerInformation structure fetched from the server at connection
      * time. It should never change during a single session and therefore it
@@ -58,7 +61,7 @@ final public class SessionImplDb extends SessionImplSocket {
         try {
             newId = cluster.createResource(clusterTranslator);
         } catch (DatabaseException e) {
-            Logger.defaultLogError(e);
+            LOGGER.error("createResource failed", e);
             return null;
         }
         return new ResourceImpl(resourceSupport, newId);
@@ -114,8 +117,7 @@ final public class SessionImplDb extends SessionImplSocket {
 //            clusterTable.dispose(); clusterTable = null;
 //            throw e;
         } catch (Throwable e) {
-            e.printStackTrace();
-            Logger.defaultLogError("Unhandled error. See exception for details.", e);
+            LOGGER.error("Unhandled error. See exception for details.", e);
             graphSession = null;
             clusterTable.dispose(); clusterTable = null;
             throw new Exception(e);