import org.simantics.db.procore.cluster.ClusterSmall;
import org.simantics.db.service.SerialisationSupport;
import org.simantics.utils.DataContainer;
+import org.slf4j.LoggerFactory;
import gnu.trove.set.hash.TIntHashSet;
public class QuerySupportImpl implements QuerySupport {
-
+
+ private static final org.slf4j.Logger LOGGER = LoggerFactory.getLogger(QuerySupportImpl.class);
+
final SessionImplSocket session;
final State state;
final ClusterTable clusterTable;
// int suggestSchedule = graph.processor.processor.resourceThread(id);
// if(graph.callerThread == suggestSchedule) {
- procedure.execute(graph, new ResourceImpl(resourceSupport, id));
+ try {
+ procedure.execute(graph, new ResourceImpl(resourceSupport, id));
+ } catch (DatabaseException e) {
+ LOGGER.error("Unexpected exception while handling object", e);
+ }
// } else {
// graph.processor.processor.schedule(graph.callerThread, new SessionTask(suggestSchedule) {
//
}
}
- procedure.finished(graph);
+ try {
+ procedure.finished(graph);
+ } catch (DatabaseException e) {
+ LOGGER.error("Unexpected exception while handling objects", e);
+ }
// graph.dec();
return;
final ClusterImpl cluster = (ClusterImpl)clusterTable.getClusterByResourceKey(subject);
if(!cluster.isLoaded()) {
- cluster.load(session.clusterTranslator, new Runnable() {
-
- @Override
- public void run() {
- getObjects4(graph, subject, procedure);
- }
-
- });
+ try {
+ cluster.load();
+ } catch (DatabaseException e) {
+ LOGGER.error("Unexpected exception while handling objects", e);
+ }
+ getObjects4(graph, subject, procedure);
return;
}
for(TransientGraph g : virtualGraphServerSupport.providers) {
for (final int id : g.getObjects(subject, procedure.predicateKey)) {
+ try {
+ procedure.execute(graph, new ResourceImpl(resourceSupport, id));
+ } catch (DatabaseException e) {
+ LOGGER.error("Unexpected exception while handling objects", e);
+ }
+
+
// int suggestSchedule = graph.processor.processor.resourceThread(id);
// if(graph.callerThread == suggestSchedule) {
- procedure.execute(graph, new ResourceImpl(resourceSupport, id));
// } else {
// graph.processor.processor.schedule(graph.callerThread, new SessionTask(suggestSchedule) {
//
// int suggestSchedule = graph.processor.processor.resourceThread(id);
// if(graph.callerThread == suggestSchedule) {
- procedure.execute(graph, context, new ResourceImpl(resourceSupport, id));
+
+ try {
+ procedure.execute(graph, context, new ResourceImpl(resourceSupport, id));
+ } catch (DatabaseException e) {
+ LOGGER.error("Unexpected exception while handling objects", e);
+ }
+
+
+
// } else {
// graph.processor.processor.schedule(graph.callerThread, new SessionTask(suggestSchedule) {
//
}
}
- procedure.finished(graph, context);
+
+ try {
+ procedure.finished(graph, context);
+ } catch (DatabaseException e) {
+ LOGGER.error("Unexpected exception while handling objects", e);
+ }
+
+
// graph.dec();
return;
for (final int id : g.getObjects(subject, procedure.predicateKey)) {
// int suggestSchedule = graph.processor.processor.resourceThread(id);
// if(graph.callerThread == suggestSchedule) {
- procedure.execute(graph, context, new ResourceImpl(resourceSupport, id));
+ try {
+ procedure.execute(graph, context, new ResourceImpl(resourceSupport, id));
+ } catch (DatabaseException e) {
+ LOGGER.error("Unexpected exception while handling objects", e);
+ }
// } else {
// graph.processor.processor.schedule(graph.callerThread, new SessionTask(suggestSchedule) {
//