]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.impl/src/org/simantics/db/impl/graph/AsyncBarrierImpl.java
Add possibility to bookkeep barrier tracing with env var
[simantics/platform.git] / bundles / org.simantics.db.impl / src / org / simantics / db / impl / graph / AsyncBarrierImpl.java
index 637db3f26f8e119173fbf29cbe54b46ed9b17002..048d70b9f7046cf82c7306222098da041806436f 100644 (file)
@@ -14,13 +14,15 @@ package org.simantics.db.impl.graph;
 import java.util.Collection;
 import java.util.concurrent.atomic.AtomicInteger;
 
-import org.simantics.db.common.utils.Logger;
 import org.simantics.db.exception.RuntimeDatabaseException;
 import org.simantics.db.impl.query.CacheEntry;
 import org.simantics.db.impl.query.QueryProcessor.AsyncBarrier;
+import org.slf4j.LoggerFactory;
 
 public class AsyncBarrierImpl extends AtomicInteger implements AsyncBarrier {
 
+    private static final org.slf4j.Logger LOGGER = LoggerFactory.getLogger(AsyncBarrierImpl.class);
+
     private static final long serialVersionUID = 4724463372850048672L;
 
     static final int WAIT_TIME = 60000;
@@ -107,7 +109,7 @@ public class AsyncBarrierImpl extends AtomicInteger implements AsyncBarrier {
                 }
             }
             if (count < 0) {
-                Logger.defaultLogError(
+                LOGGER.error(
                         "Database request processing error. The application code has performed illegal actions (probably called multiple times the execute or exception method of a single result request.",
                         new Exception());
             }
@@ -164,7 +166,7 @@ public class AsyncBarrierImpl extends AtomicInteger implements AsyncBarrier {
                 }
                 if(waitCount > WAIT_TIME) {
 
-                    System.err.println("AsyncBarrierImpl.waitBarrier("
+                    LOGGER.warn("AsyncBarrierImpl.waitBarrier("
                             + request
                             + ") is taking long to execute, so far "
                             + (waitCount / 1000) + " s.");