X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.db.procore%2Fsrc%2Ffi%2Fvtt%2Fsimantics%2Fprocore%2Finternal%2FSessionRequestManager.java;h=2902274b94202c9c79610f006f5acbf91365338b;hp=a29d6ce045bc619ceae803dfe7bf6d48cb03241a;hb=9f0fd59be54719b1fe9322d8fd37e4950857308c;hpb=856c152d1571e7600ce030f856026ce5684b499d diff --git a/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/SessionRequestManager.java b/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/SessionRequestManager.java index a29d6ce04..2902274b9 100644 --- a/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/SessionRequestManager.java +++ b/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/SessionRequestManager.java @@ -118,7 +118,7 @@ public class SessionRequestManager { public synchronized void startRead(int thread, final SessionRead task) { - session.queryProvider2.scheduleAlways(thread, new SessionTask(task.object, task.thread, task.syncCaller) { + session.queryProvider2.schedule(new SessionTask(true) { @Override public void run(int thread) { @@ -142,7 +142,7 @@ public class SessionRequestManager { public synchronized void startReadUpdate(int thread) { - session.queryProvider2.scheduleAlways(thread, new SessionTask(null, thread) { + session.queryProvider2.schedule(new SessionTask(true) { @Override public void run(int thread) { @@ -163,7 +163,7 @@ public class SessionRequestManager { public synchronized void startWrite(int thread, final SessionTask task) { - session.queryProvider2.scheduleAlways(thread, new SessionTask((WriteTraits)task.object, task.thread) { + session.queryProvider2.schedule(new SessionTask(true) { @Override public void run(int thread) { @@ -184,7 +184,7 @@ public class SessionRequestManager { public synchronized void startWriteUpdate(int thread) { - session.queryProvider2.scheduleAlways(thread, new SessionTask(null, thread) { + session.queryProvider2.schedule(new SessionTask(true) { @Override public void run(int thread) { @@ -216,6 +216,9 @@ public class SessionRequestManager { if(!session.state.isAlive()) return; WriteState writeState = session.writeState; + + assert(writeState != null); + WriteGraphImpl graph = writeState.getGraph(); if(writeState.isExcepted()) { @@ -268,7 +271,7 @@ public class SessionRequestManager { if (!reads.isEmpty()) { final SessionRead read = reads.poll(); - session.queryProvider2.scheduleAlways(thread, new SessionTask(read.object, read.thread, read.syncCaller) { + session.queryProvider2.schedule(new SessionTask(true) { @Override public void run(int thread) { @@ -296,7 +299,9 @@ public class SessionRequestManager { } else { - throw new IllegalStateException("State in ceased should be WRITE or READ or INIT (was " + state + ")"); + // Spurious wakeup + + //throw new IllegalStateException("State in ceased should be WRITE or READ or INIT (was " + state + ")"); } @@ -307,7 +312,7 @@ public class SessionRequestManager { assert(State.INIT != state); if(State.READ == state) { - session.queryProvider2.schedule(Integer.MIN_VALUE, new SessionTask(task.object, task.thread, task.syncCaller) { + session.queryProvider2.schedule(new SessionTask(true) { @Override public void run(int thread) { @@ -349,6 +354,8 @@ public class SessionRequestManager { boolean inUpdate = state == State.WRITE_UPDATE; + //System.err.println("schedule write " + task); + assert(State.INIT != state); //task.combine = combine != null ? combine : inUpdate; if(State.IDLE == state) {