]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/SessionImplSocket.java
Do not wait forever for querythreads to dispose
[simantics/platform.git] / bundles / org.simantics.db.procore / src / fi / vtt / simantics / procore / internal / SessionImplSocket.java
index a18b66e6978a03d66e46b965848b0f9c956fa961..aff219622d6b91254823d1b8fcad7df722749429 100644 (file)
@@ -143,6 +143,7 @@ import org.simantics.db.service.ClusteringSupport;
 import org.simantics.db.service.CollectionSupport;
 import org.simantics.db.service.DebugSupport;
 import org.simantics.db.service.DirectQuerySupport;
+import org.simantics.db.service.EventSupport;
 import org.simantics.db.service.GraphChangeListenerSupport;
 import org.simantics.db.service.InitSupport;
 import org.simantics.db.service.LifecycleSupport;
@@ -292,6 +293,7 @@ public abstract class SessionImplSocket implements Session, WriteRequestSchedule
         serviceLocator.registerService(ExternalValueSupport.class, new ExternalValueSupportImpl(this));
         serviceLocator.registerService(RandomAccessValueSupport.class, new RandomAccessValueSupportImpl());
         serviceLocator.registerService(ServiceActivityMonitor.class, new ServiceActivityMonitorImpl());
+        serviceLocator.registerService(EventSupport.class, new EventSupportImpl());
         ServiceActivityUpdaterForWriteTransactions.register(this);
 
         this.virtualGraphServerSupport = new VirtualGraphServerSupportImpl(this, t);
@@ -1343,7 +1345,7 @@ public abstract class SessionImplSocket implements Session, WriteRequestSchedule
 
         } catch (Throwable e) {
 
-            e.printStackTrace();
+            LOGGER.error("Could not perform write only for request {}", request, e);
 
             releaseWriteOnly(writeState.getGraph());
 
@@ -2669,7 +2671,7 @@ public abstract class SessionImplSocket implements Session, WriteRequestSchedule
                 // Serialize as '<resource index>_<cluster id>'
                 return "" + r + "_" + getCluster(resourceImpl);
             } catch (Throwable e) {
-                e.printStackTrace();
+                LOGGER.error("Could not create random access id for resource {}", resource, e);
                 throw new InvalidResourceReferenceException(e);
             } finally {
             }
@@ -2717,7 +2719,7 @@ public abstract class SessionImplSocket implements Session, WriteRequestSchedule
             } catch (NumberFormatException e) {
                 throw new InvalidResourceReferenceException(e);
             } catch (Throwable e) {
-                e.printStackTrace();
+                LOGGER.error("Could not get resource for randomAccessId {}", randomAccessId, e);
                 throw new InvalidResourceReferenceException(e);
             } finally {
             }
@@ -3460,7 +3462,7 @@ public abstract class SessionImplSocket implements Session, WriteRequestSchedule
 
             }
         } catch (InterruptedException e) {
-            e.printStackTrace();
+            LOGGER.error("Acquiring was interrupted", e);
             // FIXME: Should perhaps do something else in this case ??
         }
     }