Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: Encountered an error saving batch meta data

  1. #11

  2. #12
    Join Date
    Jan 2010
    Posts
    26

    Default

    Hi there,

    I am using Spring Batch 2.1.0 and Spring Core 3.0.2. I get the following error: [Has this error been resolved] How to prevent this error? We are using Oracle 10g RAC


    2010-04-22 19:16:58,592 506748 ERROR [task-scheduler-1] [REQ-20100422190836-1] AbstractStep - Encountered an error saving batch meta data.This job is now in an unknown state and should not be restarted.

    Here is the debug log of the above error:

    Code:
    
    2010-04-22 19:47:44,057 554469 DEBUG [task-scheduler-4] [REQ-20100422193851-1] TaskletStep - Rollback for RuntimeException: org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [UPDATE BAT.BATCH_STEP_EXECUTION_CONTEXT SET SHORT_CONTEXT = ?, SERIALIZED_CONTEXT = ? WHERE STEP_EXECUTION_ID = ?]; SQL state [72000]; error code [12899]; ORA-12899: value too large for column "BAT"."BATCH_STEP_EXECUTION_CONTEXT"."SHORT_CONTEXT" (actual: 2502, maximum: 2500)
    ; nested exception is java.sql.SQLException: ORA-12899: value too large for column "BAT"."BATCH_STEP_EXECUTION_CONTEXT"."SHORT_CONTEXT" (actual: 2502, maximum: 2500)
    
    2010-04-22 19:47:44,057 554469 DEBUG [task-scheduler-4] [REQ-20100422193851-1] TransactionTemplate - Initiating transaction rollback on application exception
    org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [UPDATE BAT.BATCH_STEP_EXECUTION_CONTEXT SET SHORT_CONTEXT = ?, SERIALIZED_CONTEXT = ? WHERE STEP_EXECUTION_ID = ?]; SQL state [72000]; error code [12899]; ORA-12899: value too large for column "BAT"."BATCH_STEP_EXECUTION_CONTEXT"."SHORT_CONTEXT" (actual: 2502, maximum: 2500)
    ; nested exception is java.sql.SQLException: ORA-12899: value too large for column "BAT"."BATCH_STEP_EXECUTION_CONTEXT"."SHORT_CONTEXT" (actual: 2502, maximum: 2500)
    
    	at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83)
    	at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
    	at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
    	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:602)
    	at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:811)
    	at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:867)
    	at org.springframework.batch.core.repository.dao.JdbcExecutionContextDao.persistSerializedContext(JdbcExecutionContextDao.java:193)
    	at org.springframework.batch.core.repository.dao.JdbcExecutionContextDao.updateExecutionContext(JdbcExecutionContextDao.java:136)
    	at org.springframework.batch.core.repository.support.SimpleJobRepository.updateExecutionContext(SimpleJobRepository.java:178)
    	at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	at java.lang.reflect.Method.invoke(Unknown Source)
    	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
    	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
    	at $Proxy13.updateExecutionContext(Unknown Source)
    	at org.springframework.batch.core.step.tasklet.TaskletStep$ChunkTransactionCallback.doInTransaction(TaskletStep.java:391)
    	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
    	at org.springframework.batch.core.step.tasklet.TaskletStep$2.doInChunkContext(TaskletStep.java:262)
    	at org.springframework.batch.core.scope.context.StepContextRepeatCallback.doInIteration(StepContextRepeatCallback.java:76)
    	at org.springframework.batch.repeat.support.RepeatTemplate.getNextResult(RepeatTemplate.java:367)
    	at org.springframework.batch.repeat.support.RepeatTemplate.executeInternal(RepeatTemplate.java:214)
    	at org.springframework.batch.repeat.support.RepeatTemplate.iterate(RepeatTemplate.java:143)
    	at org.springframework.batch.core.step.tasklet.TaskletStep.doExecute(TaskletStep.java:247)
    	at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:196)
    	at org.springframework.batch.core.job.SimpleStepHandler.handleStep(SimpleStepHandler.java:115)
    	at org.springframework.batch.core.job.flow.JobFlowExecutor.executeStep(JobFlowExecutor.java:61)
    	at org.springframework.batch.core.job.flow.support.state.StepState.handle(StepState.java:60)
    	at org.springframework.batch.core.job.flow.support.SimpleFlow.resume(SimpleFlow.java:144)
    	at org.springframework.batch.core.job.flow.support.SimpleFlow.start(SimpleFlow.java:124)
    	at org.springframework.batch.core.job.flow.FlowJob.doExecute(FlowJob.java:99)
    	at org.springframework.batch.core.job.AbstractJob.execute(AbstractJob.java:281)
    	at org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run(SimpleJobLauncher.java:120)
    	at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:48)
    	at org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:114)
    	at test.co.batch.stuff.serviceactivator.JobInvoker.launchBatchJob(JobInvoker.java:230)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	at java.lang.reflect.Method.invoke(Unknown Source)
    	at org.springframework.expression.spel.support.ReflectiveMethodExecutor.execute(ReflectiveMethodExecutor.java:58)
    	at org.springframework.expression.spel.ast.MethodReference.getValueInternal(MethodReference.java:103)
    	at org.springframework.expression.spel.ast.CompoundExpression.getValueInternal(CompoundExpression.java:57)
    	at org.springframework.expression.spel.ast.SpelNodeImpl.getValue(SpelNodeImpl.java:93)
    	at org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:93)
    	at org.springframework.integration.handler.AbstractMessageProcessor.evaluateExpression(AbstractMessageProcessor.java:48)
    	at org.springframework.integration.handler.MethodInvokingMessageProcessor.processMessage(MethodInvokingMessageProcessor.java:164)
    	at org.springframework.integration.handler.ServiceActivatingHandler.handleRequestMessage(ServiceActivatingHandler.java:60)
    	at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:91)
    	at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:63)
    	at org.springframework.integration.endpoint.HandlerInvocationChain.handleMessage(HandlerInvocationChain.java:58)
    	at org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:103)
    	at org.springframework.integration.dispatcher.UnicastingDispatcher.dispatch(UnicastingDispatcher.java:90)
    	at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:43)
    	at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:176)
    	at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:149)
    	at org.springframework.integration.channel.MessageChannelTemplate.doSend(MessageChannelTemplate.java:224)
    	at org.springframework.integration.channel.MessageChannelTemplate.send(MessageChannelTemplate.java:181)
    	at org.springframework.integration.endpoint.SourcePollingChannelAdapter.doPoll(SourcePollingChannelAdapter.java:78)
    	at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller.innerPoll(AbstractPollingEndpoint.java:236)
    	at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller.poll(AbstractPollingEndpoint.java:220)
    	at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller.run(AbstractPollingEndpoint.java:213)
    	at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:51)
    	at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81)
    	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    	at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
    	at java.util.concurrent.FutureTask.run(Unknown Source)
    	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source)
    	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    	at java.lang.Thread.run(Unknown Source)
    Caused by: java.sql.SQLException: ORA-12899: value too large for column "BAT"."BATCH_STEP_EXECUTION_CONTEXT"."SHORT_CONTEXT" (actual: 2502, maximum: 2500)
    Table BATCH_STEP_EXECUTION_CONTEXT details
    STEP_EXECUTION_ID NUMBER (19,0)
    STEP_SHORT_CONTEXT VARCHAR2 (4000 CHAR)
    SERIALIZED_CONTEXT CLOB

    Thanks.
    Last edited by msns3ka; Apr 22nd, 2010 at 03:08 AM.

  3. #13
    Join Date
    Jan 2010
    Posts
    26

    Default

    Solved this issue!

    Table BATCH_STEP_EXECUTION_CONTEXT details (not correct in my previous post above)

    STEP_EXECUTION_ID NUMBER (19,0)
    STEP_SHORT_CONTEXT VARCHAR2 (2500 CHAR)
    SERIALIZED_CONTEXT CLOB

    Increased the field 'STEP_SHORT_CONTEXT' size from 2500 to 3000 and it worked OK !

  4. #14
    Join Date
    Jun 2005
    Posts
    4,230

    Default

    Look at the job-repository configuration carefully. There is an option there to set the max-varchar-length.

  5. #15
    Join Date
    Jan 2010
    Posts
    26

    Default

    Dave,

    I tried that (increasing max-varchar-length to 3000) and still the same error. Then I increased the size of field STEP_SHORT_CONTEXT to 3000 (in table BATCH_STEP_EXECUTION_CONTEXT) and then only it worked fine.

    My Application's Step Context is very big as we are using around 20 file writers! :-)

    But anyway in the first place when we receive this error 'AbstractStep - Encountered an error saving batch meta data.This job is now in an unknown state and should not be restarted.' the JOB status should be set to FAILED but the status is set to COMPLETED. [I thinks there is a Jira http://jira.springframework.org/browse/BATCH-1503 for this and hoping it is fixed for the next release.]



    Cheers
    Last edited by msns3ka; Apr 23rd, 2010 at 04:10 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •