Announcement Announcement Module
No announcement yet.
Error when saving a StepInstance Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error when saving a StepInstance

    I am facing a blocking issue when saving a step instance/step execution.

    Here is the error stack:
    Caused by: java.sql.SQLException: Invalid column datatype
    	at oracle.jdbc.dbaccess.DBError.throwSqlException(
    	at oracle.jdbc.dbaccess.DBError.throwSqlException(
    	at oracle.jdbc.dbaccess.DBError.throwSqlException(
    	at oracle.jdbc.driver.OracleStatement.get_internal_type(
    	at oracle.jdbc.driver.OraclePreparedStatement.setNull(
    	at org.apache.commons.dbcp.DelegatingPreparedStatement.setNull(
    	at org.springframework.jdbc.core.StatementCreatorUtils.setParameterValueInternal(
    	at org.springframework.jdbc.core.StatementCreatorUtils.setParameterValue(
    	at org.springframework.jdbc.core.ArgPreparedStatementSetter.setValues(
    	at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(
    	at org.springframework.jdbc.core.JdbcTemplate.execute(
    	at org.springframework.jdbc.core.JdbcTemplate.update(
    	at org.springframework.jdbc.core.JdbcTemplate.update(
    	at org.springframework.jdbc.core.JdbcTemplate.update(
    	at org.springframework.batch.execution.repository.dao.JdbcStepDao.update(
    	at org.springframework.batch.execution.repository.SimpleJobRepository.update(
            ... (AOP transaction stuff)
    	at $Proxy10.update(Unknown Source)
    	at org.springframework.batch.execution.step.simple.SimpleStepExecutor.updateStatus(
    	at org.springframework.batch.execution.step.simple.SimpleStepExecutor.execute(
    	at org.springframework.batch.execution.step.simple.SimpleStep.execute(
    	at org.springframework.batch.execution.job.simple.SimpleJob.execute(
    Note: I had to change the datatype of LAST_STEP_EXECUTION_ID from BIGINT to NUMBER, as BIGINT datatype does not exist in Oracle9.

    When exploring this issue, I noticed that in SimpleStepExecutor.updateStatus(), the stepInstance is updated before stepExecution is created and is assigned an ID, and therefore, LAST_STEP_EXECUTION_ID is set to null. Maybe the order should be reversed (first save or update step execution, then update step instance) ?

    If this cannot be achieved for some reason and we can live with a null LAST_STEP_EXECUTION_ID, JdbcStepDao must use JdbcTemplate.update(String, Object[], int[]) instead of update(String, Object[]), in order to correctly set the datatypes of the parameters. I noticed that this simple change works. Maybe the above is a JdbcTemplate bug, or a JDBC driver bug ?

  • #2
    In m5-snapshot instance tables no longer have a reference to last execution, so updating to current trunk may solve your issue (update helped in


    • #3
      And I found that, in m4, schema-oracle10g.sql used datatypes that not exists in Oracle. You may fix occurence of BIGINT to, for example, NUMBER(38), and run the changed script yourself