- remo.remove(graph);
- if(graph.isInstanceOf(trash, L0.IndexRoot)) {
- // TODO: this should be an utility
- GenericRelationIndex index = graph.adapt(L0X.DependenciesRelation, GenericRelationIndex.class);
- IndexedRelations ir = graph.getService(IndexedRelations.class);
- // Deletes index files
- ir.reset(null, graph, L0X.DependenciesRelation, trash);
- // Notifies DB listeners
- index.reset(graph, trash);
+ try {
+ remo.remove(graph);
+ unhandled.addAll(remo.getRoots());
+ } catch (DatabaseException e) {
+ // Something went wrong - try to remove this later
+ // with EntityRemover
+ unhandled.add(trash);
+ }
+ if (isIndexRoot) {
+ // TODO: this should be an utility
+ GenericRelationIndex index = graph.adapt(L0X.DependenciesRelation,
+ GenericRelationIndex.class);
+ IndexedRelations ir = graph.getService(IndexedRelations.class);
+ // Deletes index files
+ ir.reset(null, graph, L0X.DependenciesRelation, trash);
+ // Notifies DB listeners
+ index.reset(graph, trash);