X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.db.indexing%2Fsrc%2Forg%2Fsimantics%2Fdb%2Findexing%2FIndexedRelationsImpl.java;h=b2b65a67f74a3e4725fc51a5d29257e6849e123a;hp=60e824cad0bf4f84592e25dbeda6b0a1b4939112;hb=b14aabb9b1160cbbadef994db5778a45a13f5533;hpb=f4b65f5afe961edc8d5e1696f32c8efbb8ea48f6 diff --git a/bundles/org.simantics.db.indexing/src/org/simantics/db/indexing/IndexedRelationsImpl.java b/bundles/org.simantics.db.indexing/src/org/simantics/db/indexing/IndexedRelationsImpl.java index 60e824cad..b2b65a67f 100644 --- a/bundles/org.simantics.db.indexing/src/org/simantics/db/indexing/IndexedRelationsImpl.java +++ b/bundles/org.simantics.db.indexing/src/org/simantics/db/indexing/IndexedRelationsImpl.java @@ -38,6 +38,7 @@ import org.simantics.db.common.utils.NameUtils; import org.simantics.db.exception.DatabaseException; import org.simantics.db.exception.InvalidResourceReferenceException; import org.simantics.db.indexing.IndexedRelationsSearcherBase.State; +import org.simantics.db.indexing.exception.IndexingException; import org.simantics.db.layer0.adapter.GenericRelation; import org.simantics.db.layer0.genericrelation.IndexException; import org.simantics.db.layer0.genericrelation.IndexedRelations; @@ -230,16 +231,18 @@ public class IndexedRelationsImpl implements IndexedRelations { searcher.startAccess(null, graph.getSession(), false); // At this point we have three options: // 1. we have access - if(searcher.hasAccess(false)) loaded = true; + if(searcher.hasAccess(false)) + loaded = true; // 2. something is wrong and the index cannot be cleaned - if(searcher.checkState(State.PROBLEM)) throw new DatabaseException("Searcher is in problematic state", searcher.getException()); + if(searcher.checkState(State.PROBLEM)) + throw new IndexingException("Searcher is in problematic state", searcher.getException()); // 3. something was wrong, but the index has been successfully cleaned } if(!loaded) { if(!searcher.checkState(State.NONE)) - throw new DatabaseException("Illegal searcher state " + searcher.state()); + throw new IndexingException("Illegal searcher state " + searcher.state()); try { SerialisationSupport ss = graph.getService(SerialisationSupport.class); @@ -247,7 +250,7 @@ public class IndexedRelationsImpl implements IndexedRelations { searcher.setReady(); } catch (IOException e) { searcher.setProblem(e); - throw new DatabaseException(e); + throw new IndexingException(e); } } @@ -558,7 +561,7 @@ public class IndexedRelationsImpl implements IndexedRelations { try { fullRebuild(monitor, graph); } catch (IOException e) { - throw new DatabaseException(e); + throw new IndexingException(e); } } }); @@ -582,7 +585,7 @@ public class IndexedRelationsImpl implements IndexedRelations { GenericRelation r = graph.adapt(relation, GenericRelation.class); if (r == null) - throw new DatabaseException("Given resource " + relation + "could not be adapted to GenericRelation."); + throw new IndexingException("Given resource " + relation + "could not be adapted to GenericRelation."); Object[] bound = new Object[] { ss.getRandomAccessId(indexRoot) }; GenericRelation selection = r.select(IndexedRelationsSearcherBase.getPattern(r, bound.length), bound);