Announcement Announcement Module
Collapse
No announcement yet.
ORA-01461 error while running a job Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • ORA-01461 error while running a job

    Hi,

    I run into this error while running my job
    Code:
    org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [INSER
    
    T into BATCH_STEP_EXECUTION(STEP_EXECUTION_ID, VERSION, STEP_NAME, JOB_EXECUTION_ID, START_TIME, END_TIME, STATUS, COMMI
    
    T_COUNT, ITEM_COUNT, CONTINUABLE, EXIT_CODE, EXIT_MESSAGE) values(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; SQL state [72000
    
    ]; error code [1461]; ORA-01461: can bind a LONG value only for insert into a LONG column
    
    ; nested exception is java.sql.SQLException: ORA-01461: can bind a LONG value only for insert into a LONG column

    I presume the stack trace is inserted into the EXIT_MESSAGE column...Shouldnt this be truncated ?

    Thanks..Vijay

  • #2
    Can you explain a bit more what the context is here? I'm not sure why oracle thinks you are trying to insert a LONG type. You assume that it is the exit status description that triggers the error? Can you verify that, because I'm not sure I understand why it would be converted to a LONG type?

    We do truncate the description on update. But on insert it should normally be empty, which is partly why I am confused.

    Comment


    • #3
      Hi Dave,

      I presume it is due to that...Since we essentially do not send values for this table for population as the JdbcStepExecutionDao essentially triggers the SQL insert statement....

      While running the step, we get a Null pointer exception in the business code and it gets propogated upwards...and the error above pops up...

      Once we rectified the business logic error, the step works fine...

      Hope this helps...

      Tks...Vijay

      Comment


      • #4
        Can you post the stack trace?

        Comment


        • #5
          ERROR - AbstractStep.execute(183) | Encountered an error executing the step


          ERROR - AbstractStep.execute(216) | Encountered an error saving batch meta data.This job is now in an unknown state and should not be restarted.

          org.springframework.jdbc.UncategorizedSQLException : PreparedStatementCallback; uncategorized SQLException for SQL [INSERT into BATCH_STEP_EXECUTION(STEP_EXECUTION_ID, VERSION, STEP_NAME, JOB_EXECUTION_ID, START_TIME, END_TIME, STATUS, COMMIT_COUNT, ITEM_COUNT, CONTINUABLE, EXIT_CODE, EXIT_MESSAGE) values(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; SQL state [72000]; error code [1461]; ORA-01461: can bind a LONG value only for insert into a LONG column

          ; nested exception is java.sql.SQLException: ORA-01461: can bind a LONG value only for insert into a LONG column

          at org.springframework.jdbc.support.SQLStateSQLExcept ionTranslator.translate(SQLStateSQLExceptionTransl ator.java:121)

          at org.springframework.jdbc.support.SQLErrorCodeSQLEx ceptionTranslator.translate(SQLErrorCodeSQLExcepti onTranslator.java:322)

          at org.springframework.jdbc.core.JdbcTemplate.execute (JdbcTemplate.java:582)

          at org.springframework.jdbc.core.JdbcTemplate.update( JdbcTemplate.java:767)

          at org.springframework.jdbc.core.JdbcTemplate.update( JdbcTemplate.java:825)

          at org.springframework.jdbc.core.JdbcTemplate.update( JdbcTemplate.java:829)

          at org.springframework.batch.core.repository.dao.Jdbc StepExecutionDao.saveStepExecution(JdbcStepExecuti onDao.java:199)

          at org.springframework.batch.core.repository.support. SimpleJobRepository.saveOrUpdate(SimpleJobReposito ry.java:235)

          at org.springframework.batch.core.step.AbstractStep.e xecute(AbstractStep.java:201)

          at org.springframework.batch.core.job.SimpleJob.execu te(SimpleJob.java:125)

          at org.springframework.batch.core.launch.support.Simp leJobLauncher$1.run(SimpleJobLauncher.java:86)

          at org.springframework.core.task.SyncTaskExecutor.exe cute(SyncTaskExecutor.java:49)

          at org.springframework.batch.core.launch.support.Simp leJobLauncher.run(SimpleJobLauncher.java:81)

          at com.PBSBatchJobLauncher.launchJob(PBSBatchJobLaunc her.java:139)

          at com.FeedWriter.write(FeedWriter.java:74)

          at org.springframework.batch.item.support.DelegatingI temWriter.write(DelegatingItemWriter.java:43)

          at org.springframework.batch.core.step.item.BatchList enerFactoryHelper$2.write(BatchListenerFactoryHelp er.java:99)

          at org.springframework.batch.core.step.item.SimpleIte mHandler.doWrite(SimpleItemHandler.java:101)

          at org.springframework.batch.core.step.item.SimpleIte mHandler.write(SimpleItemHandler.java:93)

          at org.springframework.batch.core.step.item.SimpleIte mHandler.handle(SimpleItemHandler.java:66)

          at org.springframework.batch.core.step.item.ItemOrien tedStep$2.doInIteration(ItemOrientedStep.java:324)

          at org.springframework.batch.repeat.support.RepeatTem plate.getNextResult(RepeatTemplate.java:346)

          at org.springframework.batch.repeat.support.RepeatTem plate.executeInternal(RepeatTemplate.java:212)

          at org.springframework.batch.repeat.support.RepeatTem plate.iterate(RepeatTemplate.java:143)

          at org.springframework.batch.core.step.item.ItemOrien tedStep.processChunk(ItemOrientedStep.java:317)

          at org.springframework.batch.core.step.item.ItemOrien tedStep$1.doInIteration(ItemOrientedStep.java:236)

          at org.springframework.batch.repeat.support.RepeatTem plate.getNextResult(RepeatTemplate.java:346)

          at org.springframework.batch.repeat.support.RepeatTem plate.executeInternal(RepeatTemplate.java:212)

          at org.springframework.batch.repeat.support.RepeatTem plate.iterate(RepeatTemplate.java:143)

          at org.springframework.batch.core.step.item.ItemOrien tedStep.doExecute(ItemOrientedStep.java:219)

          at org.springframework.batch.core.step.AbstractStep.e xecute(AbstractStep.java:168)

          at org.springframework.batch.core.job.SimpleJob.execu te(SimpleJob.java:125)

          at org.springframework.batch.core.launch.support.Simp leJobLauncher$1.run(SimpleJobLauncher.java:86)

          at org.springframework.core.task.SyncTaskExecutor.exe cute(SyncTaskExecutor.java:49)

          Comment


          • #6
            I think maybe I understand it. Did the exception in the "business code" actually happen in an ItemStream.open()? I opened a JIRA to track that issue: http://jira.springframework.org/browse/BATCH-616. If your issue is different, e.g. if the exception was somewhere else, let us know here.

            By the way, I notice from your stack trace that you have not declared a transaction advice for the job repository. Please see the section of the user guide that deals with that and/or search this forum for previous threads on transactions and/or copy the tx:advice and aop:config from the samples. That couldn't cause the exception above, but it will lead to more problems later.

            (Please use [code][/code] tags to post code and stack traces.)

            Comment

            Working...
            X