|
|
@@ -117,21 +117,29 @@ public abstract class TsbAbstractJob<I, O, R> {
|
|
|
batchLogSq = batchService.createBatchLog(batchId);
|
|
|
}
|
|
|
|
|
|
- this.printStart();
|
|
|
+ try {
|
|
|
+ this.printStart();
|
|
|
|
|
|
- readItem = this.read();
|
|
|
+ readItem = this.read();
|
|
|
|
|
|
- if (readItem != null) {
|
|
|
- convertedItem = this.process(readItem);
|
|
|
+ if (readItem != null) {
|
|
|
+ convertedItem = this.process(readItem);
|
|
|
|
|
|
- resultItem = this.write(convertedItem);
|
|
|
+ resultItem = this.write(convertedItem);
|
|
|
|
|
|
- this.notify(resultItem);
|
|
|
- } else { // 배치 처리할 대상 데이터가 없으면 종료
|
|
|
- log.info("처리할 데이터가 없습니다.\n");
|
|
|
- }
|
|
|
+ this.notify(resultItem);
|
|
|
+ } else { // 배치 처리할 대상 데이터가 없으면 종료
|
|
|
+ log.info("처리할 데이터가 없습니다.\n");
|
|
|
+ }
|
|
|
|
|
|
- this.printEnd();
|
|
|
+ this.printEnd();
|
|
|
+
|
|
|
+ } catch (Exception e) {
|
|
|
+ if (StringUtils.isNotBlank(batchId)) {
|
|
|
+ // 배치로그 종료 처리
|
|
|
+ batchService.updateBatchLog(batchLogSq, batchId);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|