X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=bundles%2Forg.simantics.db.common%2Fsrc%2Forg%2Fsimantics%2Fdb%2Fcommon%2Futils%2FTransaction.java;h=96d915482e53b91efb9f5e536d7d0e0d480a3868;hb=refs%2Fchanges%2F48%2F2448%2F1;hp=75020215d686d00c79fd72a870c00e3184c7be60;hpb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.db.common/src/org/simantics/db/common/utils/Transaction.java b/bundles/org.simantics.db.common/src/org/simantics/db/common/utils/Transaction.java index 75020215d..96d915482 100644 --- a/bundles/org.simantics.db.common/src/org/simantics/db/common/utils/Transaction.java +++ b/bundles/org.simantics.db.common/src/org/simantics/db/common/utils/Transaction.java @@ -13,15 +13,16 @@ package org.simantics.db.common.utils; import java.util.Collection; import java.util.Set; import java.util.concurrent.Semaphore; +import java.util.function.Consumer; import org.simantics.databoard.accessor.Accessor; import org.simantics.databoard.binding.Binding; import org.simantics.databoard.type.Datatype; +import org.simantics.db.AsyncRequestProcessor; import org.simantics.db.ReadGraph; import org.simantics.db.RequestProcessor; import org.simantics.db.Resource; import org.simantics.db.Statement; -import org.simantics.db.VirtualGraph; import org.simantics.db.WriteGraph; import org.simantics.db.WriteOnlyGraph; import org.simantics.db.common.request.DelayedWriteRequest; @@ -40,9 +41,7 @@ import org.simantics.db.exception.ValidationException; import org.simantics.db.procedure.Procedure; import org.simantics.db.request.DelayedWrite; import org.simantics.db.request.Read; -import org.simantics.db.request.UndoTraits; import org.simantics.db.request.Write; -import org.simantics.utils.datastructures.Callback; /** * Synchronous Transaction.
@@ -152,11 +151,11 @@ public class Transaction {
}
}
- public static void startTransaction(RequestProcessor processor, boolean write) throws DatabaseException {
+ public static void startTransaction(AsyncRequestProcessor processor, boolean write) throws DatabaseException {
startTransaction(processor, write ? Type.WRITE : Type.READ);
}
- public static void startTransaction(RequestProcessor processor, Type type) throws DatabaseException {
+ public static void startTransaction(AsyncRequestProcessor processor, Type type) throws DatabaseException {
switch (type) {
case READ:
{
@@ -218,12 +217,9 @@ public class Transaction {
t.ts = new Semaphore(0);
transactions.set(t);
- Callback