While executing
private static final String CURRENT_VERSION_JOB_EXECUTION = "SELECT VERSION FROM %PREFIX%JOB_EXECUTION WHERE JOB_EXECUTION_ID=?";
by spring (it is already written in JdbcJobExecutionDao) i am gettting this error
Encountered fatal error executing joborg.springframework.dao.EmptyResultDataAccessException: Incorrect result size: expected 1, actual 0
it is not able to get record from batch_job_execution table but record is present in table. my app is running on kubernetes and i m getting this error from kubernetes but not from my local code.
According to the documentation
Data access exception thrown when a result was expected to have at least one row (or element) but zero rows (or elements) were actually returned.
You can approach this in few ways:
Modify your query to always return 1 result.
Catch the exception and apply a behavior that you find fit. For example you can check this guide and use it as an example.
Use query method
instead to avoid this exception.
Please let me know if that helped.