Make countStepExecutions access batch_job_execution only once

Change JdbcStepExecutionDao.COUNT_STEP_EXECUTIONS to access the
table batch_job_execution only once.

Issue #3876
This commit is contained in:
Philippe Marschall
2021-03-28 17:51:40 +02:00
committed by Mahmoud Ben Hassine
parent 8d89a4b04e
commit 9710220c14

View File

@@ -105,11 +105,9 @@ public class JdbcStepExecutionDao extends AbstractJdbcBatchMetadataDao implement
"STEP_EXECUTION_ID=?";
private static final String COUNT_STEP_EXECUTIONS = "SELECT COUNT(*) " +
" from %PREFIX%JOB_EXECUTION JE, %PREFIX%STEP_EXECUTION SE" +
" where " +
" SE.JOB_EXECUTION_ID in (SELECT JOB_EXECUTION_ID from %PREFIX%JOB_EXECUTION " +
"where JOB_INSTANCE_ID = ?)" +
" and SE.JOB_EXECUTION_ID = JE.JOB_EXECUTION_ID " +
" from %PREFIX%JOB_EXECUTION JE JOIN %PREFIX%STEP_EXECUTION SE " +
" on SE.JOB_EXECUTION_ID = JE.JOB_EXECUTION_ID " +
"where JE.JOB_INSTANCE_ID = ?" +
" and SE.STEP_NAME = ?";
private int exitMessageLength = DEFAULT_EXIT_MESSAGE_LENGTH;