@Test public void testRepairProcessingExternalCallsOne() throws Exception { ExternalCall externalCall = createAndSaveExternalCalls(1)[0]; externalCallService.repairProcessingExternalCalls(); externalCallService.repairProcessingExternalCalls(); ExternalCall found = externalCallDao.getExternalCall( externalCall.getOperationName(), externalCall.getEntityId()); assertThat(found, notNullValue()); assertThat(found.getState(), is(ExternalCallStateEnum.FAILED)); }
@Override public void repairProcessingExternalCalls() { List<ExternalCall> extCalls = findProcessingExternalCalls(); Log.debug("Found {} external call(s) for repairing ...", extCalls.size()); int batchStartIncl = 0; int batchEndExcl; while (batchStartIncl < extCalls.size()) { batchEndExcl = min(batchStartIncl + BATCH_SIZE, extCalls.size()); updateExternalCallsInDB(extCalls.subList(batchStartIncl, batchEndExcl)); batchStartIncl = batchEndExcl; } }
RepairExternalCallDbImpl implements RepairExternalCallService { @Override public void repairProcessingExternalCalls() { List<ExternalCall> extCalls = findProcessingExternalCalls(); Log.debug("Found {} external call(s) for repairing ...", extCalls.size()); int batchStartIncl = 0; int batchEndExcl; while (batchStartIncl < extCalls.size()) { batchEndExcl = min(batchStartIncl + BATCH_SIZE, extCalls.size()); updateExternalCallsInDB(extCalls.subList(batchStartIncl, batchEndExcl)); batchStartIncl = batchEndExcl; } } }
RepairExternalCallDbImpl implements RepairExternalCallService { @Override public void repairProcessingExternalCalls() { List<ExternalCall> extCalls = findProcessingExternalCalls(); Log.debug("Found {} external call(s) for repairing ...", extCalls.size()); int batchStartIncl = 0; int batchEndExcl; while (batchStartIncl < extCalls.size()) { batchEndExcl = min(batchStartIncl + BATCH_SIZE, extCalls.size()); updateExternalCallsInDB(extCalls.subList(batchStartIncl, batchEndExcl)); batchStartIncl = batchEndExcl; } }  }
RepairExternalCallDbImpl implements RepairExternalCallService { @Override public void repairProcessingExternalCalls() { List<ExternalCall> extCalls = findProcessingExternalCalls(); Log.debug("Found {} external call(s) for repairing ...", extCalls.size()); int batchStartIncl = 0; int batchEndExcl; while (batchStartIncl < extCalls.size()) { batchEndExcl = min(batchStartIncl + BATCH_SIZE, extCalls.size()); updateExternalCallsInDB(extCalls.subList(batchStartIncl, batchEndExcl)); batchStartIncl = batchEndExcl; } }  @Override void repairProcessingExternalCalls(); @Required void setTransactionManager(JpaTransactionManager transactionManager); void setExternalCallDao(ExternalCallDao externalCallDao); }
RepairExternalCallDbImpl implements RepairExternalCallService { @Override public void repairProcessingExternalCalls() { List<ExternalCall> extCalls = findProcessingExternalCalls(); Log.debug("Found {} external call(s) for repairing ...", extCalls.size()); int batchStartIncl = 0; int batchEndExcl; while (batchStartIncl < extCalls.size()) { batchEndExcl = min(batchStartIncl + BATCH_SIZE, extCalls.size()); updateExternalCallsInDB(extCalls.subList(batchStartIncl, batchEndExcl)); batchStartIncl = batchEndExcl; } }  @Override void repairProcessingExternalCalls(); @Required void setTransactionManager(JpaTransactionManager transactionManager); void setExternalCallDao(ExternalCallDao externalCallDao);  }