Announcement Announcement Module
Collapse
No announcement yet.
Multiple jobs at same time, getting lock on job id (BATCH_JOB_SEQ) table Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Multiple jobs at same time, getting lock on job id (BATCH_JOB_SEQ) table

    Our job reposotory is on SQL Server 2000 database and starting multiple jobs at same time, getting fillowing error, which database lock on above table and so unble to get next job id. Any help on how to resolve this error would be appreciated.

    Here is my jobRepository def:

    <bean id="jobRepository"
    class="org.springframework.batch.core.repository.s upport.JobRepositoryFactoryBean">
    <property name="dataSource" ref="dataSourceSpringBatchRepo" />
    <property name="transactionManager" ref="txnManagerSpringBatchRepo" />
    <property name="databaseType" value="SQLSERVER" />
    <property name="tablePrefix" value="gssm_etl_batch_" />
    <property name="isolationLevelForCreate" value="ISOLATION_SERIALIZABLE" />
    <property name="lobHandler" ref="lobHandler" />
    </bean>

    2013-06-10 16:14:45.802 [ INFO] [SimpleAsyncTaskExecutor-2] org.springframework.batch.core.job.SimpleStepHandl er:133 => Executing step: [flowLoadShavlikSpecActvAsmnts-stepDoNothing]
    2013-06-10 16:14:45.855 [ERROR] [main] org.springframework.batch.core.job.AbstractJob:306 => Encountered fatal error executing job
    org.springframework.batch.core.JobExecutionExcepti on: Flow execution ended unexpectedly
    at org.springframework.batch.core.job.flow.FlowJob.do Execute(FlowJob.java:141)
    at org.springframework.batch.core.job.AbstractJob.exe cute(AbstractJob.java:281)
    at org.springframework.batch.core.launch.support.Simp leJobLauncher$1.run(SimpleJobLauncher.java:120)
    at org.springframework.core.task.SyncTaskExecutor.exe cute(SyncTaskExecutor.java:48)
    at org.springframework.batch.core.launch.support.Simp leJobLauncher.run(SimpleJobLauncher.java:114)
    at org.springframework.batch.core.launch.support.Comm andLineJobRunner.start(CommandLineJobRunner.java:3 49)
    at org.springframework.batch.core.launch.support.Comm andLineJobRunner.main(CommandLineJobRunner.java:57 4)
    Caused by: org.springframework.batch.core.job.flow.FlowExecut ionException: Ended flow=jobLoadWindowsTemSpecActvAsmnts-splitLoad.0 at state=jobLoadWindowsTemSpecActvAsmnts-splitLoad.0.flowLoadTemDevices-stepLoad with exception
    at org.springframework.batch.core.job.flow.support.Si mpleFlow.resume(SimpleFlow.java:152)
    at org.springframework.batch.core.job.flow.support.Si mpleFlow.start(SimpleFlow.java:124)
    at org.springframework.batch.core.job.flow.support.st ate.SplitState$1.call(SplitState.java:91)
    at org.springframework.batch.core.job.flow.support.st ate.SplitState$1.call(SplitState.java:90)
    at java.util.concurrent.FutureTask$Sync.innerRun(Futu reTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.jav a:138)
    at java.lang.Thread.run(Thread.java:662)
    Caused by: org.springframework.dao.DataAccessResourceFailureE xception: Could not increment identity; nested exception is com.microsoft.sqlserver.jdbc.SQLServerException: Transaction (Process ID 61) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
    at org.springframework.jdbc.support.incrementer.SqlSe rverMaxValueIncrementer.getNextKey(SqlServerMaxVal ueIncrementer.java:108)
    at org.springframework.jdbc.support.incrementer.Abstr actDataFieldMaxValueIncrementer.nextLongValue(Abst ractDataFieldMaxValueIncrementer.java:125)
    at org.springframework.batch.core.repository.dao.Jdbc StepExecutionDao.saveStepExecution(JdbcStepExecuti onDao.java:117)
    at org.springframework.batch.core.repository.support. SimpleJobRepository.add(SimpleJobRepository.java:1 62)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.springframework.aop.support.AopUtils.invokeJoi npointUsingReflection(AopUtils.java:318)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.invokeJoinpoint(ReflectiveMethodInvocat ion.java:183)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :150)
    at org.springframework.transaction.interceptor.Transa ctionInterceptor.invoke(TransactionInterceptor.jav a:110)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :172)
    at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:202)
    at $Proxy6.add(Unknown Source)
    at org.springframework.batch.core.job.SimpleStepHandl er.handleStep(SimpleStepHandler.java:131)
    at org.springframework.batch.core.job.flow.JobFlowExe cutor.executeStep(JobFlowExecutor.java:61)
    at org.springframework.batch.core.job.flow.support.st ate.StepState.handle(StepState.java:60)
    at org.springframework.batch.core.job.flow.support.Si mpleFlow.resume(SimpleFlow.java:144)
    ... 6 more
    Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Transaction (Process ID 61) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
    at com.microsoft.sqlserver.jdbc.SQLServerException.ma keFromDatabaseError(SQLServerException.java:197)
    at com.microsoft.sqlserver.jdbc.TDSTokenHandler.onEOF (tdsparser.java:246)
    at com.microsoft.sqlserver.jdbc.TDSParser.parse(tdspa rser.java:83)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.ge tNextResult(SQLServerStatement.java:1488)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.do ExecuteStatement(SQLServerStatement.java:775)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement$St mtExecCmd.doExecute(SQLServerStatement.java:676)
    at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IO Buffer.java:4575)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.e xecuteCommand(SQLServerConnection.java:1400)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.ex ecuteCommand(SQLServerStatement.java:179)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.ex ecuteStatement(SQLServerStatement.java:154)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.ex ecuteUpdate(SQLServerStatement.java:633)
    at org.apache.commons.dbcp.DelegatingStatement.execut eUpdate(DelegatingStatement.java:228)
    at org.apache.commons.dbcp.DelegatingStatement.execut eUpdate(DelegatingStatement.java:228)
    at org.springframework.jdbc.support.incrementer.SqlSe rverMaxValueIncrementer.getNextKey(SqlServerMaxVal ueIncrementer.java:105)
    ... 24 more
    2013-06-10 16:14:45.956 [ INFO] [SimpleAsyncTaskExecutor-2] org.springframework.batch.core.job.SimpleStepHandl er:133 => Executing step: [flowLoadSmsSpecActvAsmnts-stepDoNothing]
    2013-06-10 16:14:46.231 [ INFO] [main] org.springframework.batch.core.launch.support.Simp leJobLauncher:121 => Job: [FlowJob: [name=jobLoadWindowsTemSpecActvAsmnts]] completed with the following parameters: [{job_run_date_time=1370895264181}] and the following status: [FAILED]
    2013-06-10 16:14:46.232 [ INFO] [main] org.springframework.context.support.ClassPathXmlAp plicationContext:1020 => Closing org.springframework.context.support.ClassPathXmlAp plicationContext@e949f69: startup date [Mon Jun 10 16:14:03 EDT 2013]; root of context hierarchy
Working...
X