X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.db.procore%2Fsrc%2Ffi%2Fvtt%2Fsimantics%2Fprocore%2Finternal%2FWriteSupportImpl.java;h=247df4645c5b207c13f2e19dbb94d84af31bc850;hb=acd711765a4a064361b3a51aa0aaeae9881fd43f;hp=4b3bf37a5789831d494d490f6cb0b4ca6d55d1fa;hpb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/WriteSupportImpl.java b/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/WriteSupportImpl.java index 4b3bf37a5..247df4645 100644 --- a/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/WriteSupportImpl.java +++ b/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/WriteSupportImpl.java @@ -3,13 +3,11 @@ package fi.vtt.simantics.procore.internal; import java.util.TreeMap; import org.simantics.db.Metadata; -import org.simantics.db.Operation; import org.simantics.db.Resource; import org.simantics.db.VirtualGraph; import org.simantics.db.WriteGraph; import org.simantics.db.common.MetadataUtils; import org.simantics.db.common.exception.DebugException; -import org.simantics.db.common.utils.Logger; import org.simantics.db.exception.DatabaseException; import org.simantics.db.exception.ImmutableException; import org.simantics.db.exception.ServiceException; @@ -29,9 +27,13 @@ import org.simantics.db.request.WriteOnly; import org.simantics.db.request.WriteResult; import org.simantics.db.request.WriteTraits; import org.simantics.db.service.ByteReader; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class WriteSupportImpl implements WriteSupport { + private static final Logger LOGGER = LoggerFactory.getLogger(WriteSupportImpl.class); + final private SessionImplSocket session; final private QueryProcessor queryProcessor; final private State state; @@ -123,7 +125,7 @@ public class WriteSupportImpl implements WriteSupport { try { addSetValue(((ResourceImpl) resource).id, value, value.length); } catch (DatabaseException e) { - Logger.defaultLogError(e); + LOGGER.error("writeOnly setValue({}, {}, byte[{}]) failed", provider, resource, value.length, e); } } } else { @@ -135,7 +137,7 @@ public class WriteSupportImpl implements WriteSupport { try { addSetValue(((ResourceImpl) resource).id, value, value.length); } catch (DatabaseException e) { - Logger.defaultLogError(e); + LOGGER.error("setValue({}, {}, byte[{}]) failed", provider, resource, value.length, e); } } queryProcessor.releaseWrite(session.writeState.getGraph()); @@ -200,7 +202,7 @@ public class WriteSupportImpl implements WriteSupport { try { cluster.removeValue(key, session.clusterTranslator); } catch (DatabaseException e) { - Logger.defaultLogError(e); + LOGGER.error("denyValue({}, {}) failed", provider, resource, e); return; } queryProcessor.updateValue(key); @@ -262,7 +264,7 @@ public class WriteSupportImpl implements WriteSupport { // graph.state.barrier.dec(); // graph.waitAsync(request); - queryProcessor.performDirtyUpdates(graph); + queryProcessor.propagateChangesInQueryCache(graph); // Do not fire metadata listeners for virtual requests if(graph.getProvider() == null) { @@ -292,7 +294,7 @@ public class WriteSupportImpl implements WriteSupport { // graph.state.barrier.dec(); // graph.waitAsync(request); - queryProcessor.performDirtyUpdates(graph); + queryProcessor.propagateChangesInQueryCache(graph); // Do not fire metadata listeners for virtual requests if(graph.getProvider() == null) { @@ -319,7 +321,7 @@ public class WriteSupportImpl implements WriteSupport { ReadGraphImpl impl = (ReadGraphImpl)graph; - queryProcessor.performDirtyUpdates(impl); + queryProcessor.propagateChangesInQueryCache(impl); // Do not fire metadata listeners for virtual requests if(graph.getProvider() == null) { @@ -388,7 +390,6 @@ public class WriteSupportImpl implements WriteSupport { MetadataUtils.addMetadata(session, metadata, data); } - @SuppressWarnings("unchecked") @Override public T getMetadata(Class clazz) throws ServiceException { return MetadataUtils.getMetadata(session, metadata, clazz); @@ -462,7 +463,7 @@ public class WriteSupportImpl implements WriteSupport { if (null != c && c != cluster) session.clusterTable.replaceCluster(c); } catch (DatabaseException e) { - Logger.defaultLogError(e); + LOGGER.error("claimImpl({}, {}, {}) failed", subject, predicate, object, e); throw new RuntimeException(e); } queryProcessor.updateStatements(subject, predicate); @@ -482,7 +483,7 @@ public class WriteSupportImpl implements WriteSupport { if (null != c && c != cluster) session.clusterTable.replaceCluster(c); } catch (DatabaseException e) { - Logger.defaultLogError(e); + LOGGER.error("claimImpl2({}, {}, {}) failed", subject, predicate, object, e); } if (cluster.isWriteOnly()) return; @@ -506,7 +507,7 @@ public class WriteSupportImpl implements WriteSupport { try { cluster.denyRelation(subject, predicate, object, session.clusterTranslator); } catch (DatabaseException e) { - Logger.defaultLogError(e); + LOGGER.error("removeStatement({}, {}, {}) failed", subject, predicate, object, e); return false; } queryProcessor.updateStatements(subject, predicate);