- UnsupportedOperationException e = new UnsupportedOperationException("org.simantics.acorn.GraphClientImpl2.cancelCommit() is not supported operation! Closing down to prevent further havoc");
- clusters.notSafeToMakeSnapshot(new IllegalAcornStateException(e));
- throw e;
-// System.err.println("GraphClientImpl2.cancelCommit() called!! this is experimental and might cause havoc!");
-// try {
-// undo(new long[] {changeSetId}, onChangeSetUpdate);
-// } catch (SDBException e) {
-// e.printStackTrace();
-// throw new ProCoreException(e);
-// }
-// clusters.state.headChangeSetId++;
-// return clusters.state.headChangeSetId;
+ // Accept and finalize current transaction and then undo it
+ acceptCommit(transactionId, changeSetId, metadata);
+
+ try {
+ undo(new long[] {changeSetId+1}, onChangeSetUpdate);
+ clusters.state.headChangeSetId++;
+ return clusters.state.headChangeSetId;
+ } catch (SDBException e) {
+ Logger.defaultLogError("Failed to undo cancelled transaction", e);
+ throw new ProCoreException(e);
+ }