Hi All,
We are running the batch by calling
Code:try { executionId = jobOperator.start(formatedStepName, jobParametersString); } catch (Exception exception2) { LOGGER.error(exception2); } finally { //get the BATCH_JOB_EXECUTION status. String jobExecutionStatus = stepListDao.retrieveBatchExecutionStatus(executionId); if (jobExecutionStatus.equals(JobExecutionStatus.FAILED.getValue())) { currentStepListDo.setStatusCode(RunTaskListStatus.FAILED.getCode()); } else if (jobExecutionStatus.equals(JobExecutionStatus.COMPLETED.getValue())) { currentStepListDo.setStatusCode(RunTaskListStatus.PROCESSED.getCode()); }
if any hibernate exception like JDBCConnectionException occurs, the status of the BATCH_JOB_EXECUTION will be updated to failed?
In our application, i got one scenario like, JDBCConnectionException occurred. In the processor we have catched the Exception and rethrown to make the job to fail. But while quering the BATCH_JOB_EXECUTION (in finally block) with the JOB_EXECUTION_ID = executionId, the status is in completed stage.Code:Hibernate. Cause: org.hibernate.exception.JDBCConnectionException: could not execute query
How is this possible? This is happened while our client running batch in production copy. But we couldn't recreate the same scenario.


Reply With Quote