import org.simantics.db.impl.Table;
import org.simantics.db.impl.TableHeader;
import org.simantics.db.impl.graph.ReadGraphImpl;
-import org.simantics.db.procedure.AsyncContextMultiProcedure;
-import org.simantics.db.procedure.AsyncMultiProcedure;
+import org.simantics.db.procedure.SyncContextMultiProcedure;
+import org.simantics.db.procedure.SyncMultiProcedure;
import org.simantics.db.service.ClusterUID;
import org.simantics.db.service.ResourceUID;
import org.slf4j.Logger;
return objectTable.getSingleObject(objectIndex, support, this);
}
- public void forObjects(ReadGraphImpl graph, int resourceKey, int predicateKey, int objectIndex, AsyncMultiProcedure<Resource> procedure,
+ public void forObjects(ReadGraphImpl graph, int resourceKey, int predicateKey, int objectIndex, SyncMultiProcedure<Resource> procedure,
ClusterSupport support) throws DatabaseException {
if (deleted) return;
if (DEBUG)
objectTable.foreachObject(graph, objectIndex, procedure, this);
}
- public <C> void forObjects(ReadGraphImpl graph, int resourceKey, int predicateKey, int objectIndex, C context, AsyncContextMultiProcedure<C, Resource> procedure,
+ public <C> void forObjects(ReadGraphImpl graph, int resourceKey, int predicateKey, int objectIndex, C context, SyncContextMultiProcedure<C, Resource> procedure,
ClusterSupport support) throws DatabaseException {
if (DEBUG)
System.out.println("ClusterSmall.forObjects1: rk=" + resourceKey + " pk=" + predicateKey);
@Override
public void forObjects(ReadGraphImpl graph, int resourceKey,
- int predicateKey, AsyncMultiProcedure<Resource> procedure) throws DatabaseException {
+ int predicateKey, SyncMultiProcedure<Resource> procedure) throws DatabaseException {
if (deleted) return;
SessionImplSocket session = (SessionImplSocket)graph.getSession();
ClusterSupport support = session.clusterTranslator;
if (ClusterTraitsSmall.resourceRefIsLocal(resourceRef)) {
key = clusterBits | resourceRef;
} else {
- foreignTable.fillResourceUID(ClusterTraitsSmall.resourceRefGetForeignIndex((short)resourceRef), this);
- key = ClusterTraitsBase.createResourceKey(clusterSupport.getClusterKeyByClusterUIDOrMake(clusterUID1, clusterUID2), executeIndex);
+ // TODO: not so nice
+ synchronized(this) {
+ foreignTable.fillResourceUID(ClusterTraitsSmall.resourceRefGetForeignIndex((short)resourceRef), this);
+ key = ClusterTraitsBase.createResourceKey(clusterSupport.getClusterKeyByClusterUIDOrMake(clusterUID1, clusterUID2), executeIndex);
+ }
}
if (DEBUG)
System.out.println("ClusterSmall.execute key=" + key);