X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.db.procore%2Fsrc%2Ffi%2Fvtt%2Fsimantics%2Fprocore%2Finternal%2FSessionRequestManager.java;h=06cd5ae9df45f534a9b83305e290b609ee17bce1;hb=68ce0966a57f5153b133c6283fdbae10f683b745;hp=0ec6387ae941b0e9cb9c6358282c3b3849ff9d0d;hpb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;p=simantics%2Fplatform.git 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 0ec6387ae..06cd5ae9d 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 @@ -4,6 +4,7 @@ import java.io.IOException; import java.util.Collection; import java.util.LinkedList; +import org.simantics.db.Disposable; import org.simantics.db.Resource; import org.simantics.db.common.utils.Logger; import org.simantics.db.exception.CancelTransactionException; @@ -213,6 +214,7 @@ public class SessionRequestManager { } else { throw new UnsupportedOperationException("delayedWriteState may only exist when request fails."); } + Disposable.safeDispose(session.clientChanges); session.clientChanges = new ClientChangesImpl(session); delayedState.finish(); return; @@ -222,6 +224,9 @@ public class SessionRequestManager { if(!session.state.isAlive()) return; WriteState writeState = session.writeState; + + assert(writeState != null); + WriteGraphImpl graph = writeState.getGraph(); if(writeState.isExcepted()) { @@ -242,6 +247,7 @@ public class SessionRequestManager { } + Disposable.safeDispose(session.clientChanges); session.clientChanges = new ClientChangesImpl(session); WriteState state = session.writeState; @@ -315,7 +321,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 + ")"); } @@ -368,6 +376,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) {