# HG changeset patch # User Robert Casties # Date 1497622086 -7200 # Node ID 4845dff46ad9174c41b17a2e079063f5869a9395 # Parent 4c9ceb28cfd0a86bfde789021474da781270235d remove Exceptions from refreshRelations. diff -r 4c9ceb28cfd0 -r 4845dff46ad9 src/main/java/org/mpi/openmind/repository/services/AbstractPersistenceService.java --- a/src/main/java/org/mpi/openmind/repository/services/AbstractPersistenceService.java Fri Jun 16 15:41:39 2017 +0200 +++ b/src/main/java/org/mpi/openmind/repository/services/AbstractPersistenceService.java Fri Jun 16 16:08:06 2017 +0200 @@ -668,12 +668,14 @@ */ private void refreshRelationTarget(Session session, Relation rel) throws Exception { if(rel.getTargetId() == null){ - throw new Exception("Refreshing entity " + rel.getSourceId() + ", the system found a relation with empty target."); + logger.error("Refreshing entity " + rel.getSourceId() + ", the system found a relation with empty target."); + return; } StringBuilder sb = new StringBuilder("refreshTarget of " + rel.toString() + " to "+rel.printTarget()); List entityList = this.getEntities(session, rel.getTargetId(), Node.SYS_STATUS_CURRENT_VERSION, rel.getType(), null, false); if(entityList.isEmpty()){ - throw new Exception("Refreshing entity " + rel.getSourceId() + ", the system found a relation without target. " + rel.toString()); + logger.error("Refreshing entity " + rel.getSourceId() + ", the system found a relation without target. " + rel.toString()); + return; } Entity target = entityList.get(0); long targetModifOld = rel.getTargetModif(); @@ -696,12 +698,14 @@ */ private void refreshRelationSource(Session session, Relation rel) throws Exception { if(rel.getSourceId() == null){ - throw new Exception("Refreshing entity " + rel.getTargetId() + ", the system found a relation with emtpy source."); + logger.error("Refreshing entity " + rel.getTargetId() + ", the system found a relation with emtpy source."); + return; } StringBuilder sb = new StringBuilder("refreshSource of " + rel.toString() + " to "+rel.printSource()); List entityList = this.getEntities(session, rel.getSourceId(), Node.SYS_STATUS_CURRENT_VERSION, rel.getType(), null, false); if(entityList.isEmpty()){ - throw new Exception("Refreshing entity " + rel.getTargetId() + ", the system found a relation without source. " + rel.toString()); + logger.error("Refreshing entity " + rel.getTargetId() + ", the system found a relation without source. " + rel.toString()); + return; } Entity source = entityList.get(0); long sourceModifOld = rel.getSourceModif();