Skip to content

Commit 38e85ef

Browse files
committed
ensure an erroring merge task is fully undone on exception but refresh the Shepherd for the next task to proceed
1 parent a3f9074 commit 38e85ef

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/java/org/ecocean/scheduled/ScheduledIndividualMerge.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,12 @@ public ScheduledIndividualMerge(MarkedIndividual primaryIndividual,
4646

4747
} catch (Exception e) {
4848
this.setTaskIncomplete();
49+
//rollback this Shepherd to unwind this task and re-open the Shepherd in case it is being reused by a subsequent Task
50+
myShepherd.rollbackDBTransaction();
51+
myShepherd.beginDBTransaction();
4952
e.printStackTrace();
50-
}
53+
}
54+
5155
}
5256

5357
private void mergeIndividuals(MarkedIndividual primaryIndividual,

0 commit comments

Comments
 (0)