Here's the more detailed description of another instace of deadlock
Code:
12:34:30,170 DEBUG SimpleAsyncTaskExecutor-274 TaskletStep:393 - Saving step execution before commit: StepExecution: id=19076, name=loadPosnDly, status=STARTED, exitStatus=EXECUTING, readCount=1, filterCount=0, writeCount=1 readSkipCount=0, writeSkipCount=0, processSkipCount=0, commitCount=2, rollbackCount=0, exitDescription=
12:34:30,891 INFO SimpleAsyncTaskExecutor-274 XmlBeanDefinitionReader:315 - Loading XML bean definitions from class path resource [org/springframework/jdbc/support/sql-error-codes.xml]
12:34:30,892 INFO SimpleAsyncTaskExecutor-275 SimpleStepHandler:113 - Executing step: [TaskletStep: [name=distTrans]]
12:34:30,900 DEBUG SimpleAsyncTaskExecutor-275 AbstractStep:180 - Executing: id=19091
12:34:30,924 INFO SimpleAsyncTaskExecutor-274 SQLErrorCodesFactory:125 - SQLErrorCodes loaded: [DB2, Derby, H2, HSQL, Informix, MS-SQL, MySQL, Oracle, PostgreSQL, Sybase]
12:34:30,927 DEBUG SimpleAsyncTaskExecutor-275 StepContextRepeatCallback:67 - Preparing chunk execution for StepContext: org.springframework.batch.core.scope.context.StepContext@2efc8618
12:34:30,929 DEBUG SimpleAsyncTaskExecutor-275 StepContextRepeatCallback:75 - Chunk execution starting: queue size=0
12:34:30,933 DEBUG SimpleAsyncTaskExecutor-275 StepScope:148 - Creating object in scope=step, name=scopedTarget.transDist
12:34:30,936 DEBUG SimpleAsyncTaskExecutor-275 TransDistribution:31 - Call trans distrubtion for batchId=3063
12:34:30,946 ERROR SimpleAsyncTaskExecutor-274 AbstractStep:213 - Encountered an error executing the step
org.springframework.transaction.UnexpectedRollbackException: Transaction rolled back because it has been marked as rollback-only
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:717)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:147)
at org.springframework.batch.core.step.tasklet.TaskletStep$2.doInChunkContext(TaskletStep.java:261)
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.support.state.SplitState$1.call(SplitState.java:83)
at org.springframework.batch.core.job.flow.support.state.SplitState$1.call(SplitState.java:81)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.lang.Thread.run(Thread.java:619)
12:34:30,981 DEBUG SimpleAsyncTaskExecutor-275 TaskletStep:381 - Applying contribution: [StepContribution: read=0, written=0, filtered=0, readSkips=0, writeSkips=0, processSkips=0, exitStatus=EXECUTING]
Here's the sybase db log..
Code:
01:00000:01354:2010/06/18 12:34:30.84 server Deadlock Id 125 detected
Deadlock Id 125: detected. 1 deadlock chain(s) involved.
Deadlock Id 125: Process (Familyid 0, Spid 1324, Suid 32) was executing a UPDATE command at line 1.
Deadlock Id 125: Process 1324 was involved in application ''.
Deadlock Id 125: Process 1324 was involved on host name 'xxxxx'.
Deadlock Id 125: Process 1324 was involved in transaction '$chained_transaction'.
SQL Text:
Deadlock Id 125: Process (Familyid 0, Spid 1354, Suid 32) was executing a SELECT command at line 1.
Deadlock Id 125: Process 1354 was involved in application ''.
Deadlock Id 125: Process 1354 was involved on host name 'xxxx'.
Deadlock Id 125: Process 1354 was involved in transaction '$chained_transaction'.
SQL Text: SELECT STEP_EXECUTION_ID, STEP_NAME, START_TIME, END_TIME, STATUS, COMMIT_COUNT, READ_COUNT, FILTER_COUNT, WRITE_COUNT, EXIT_CODE, EXIT_MESSAGE, READ_SKIP_COUNT, WRITE_SKIP_COUNT, PROCESS_SKIP_COUNT, ROLLBACK_COUNT, LAST_UPDATED, VERSION from BATCH_STEP_EXECUTION where JOB_EXECUTION_ID = @p0 order by STEP_EXECUTION_IDì
Deadlock Id 125: Process (Familyid 0, Spid 1354) was waiting for a 'shared row' lock on row 0 page 976758 of the 'BATCH_STEP_EXECUTION' table in database 'pmdb_load' but process (Familyid 0, Spid 1324) already held a 'exclusive row' lock on it.
Deadlock Id 125: Process (Familyid 0, Spid 1324) was waiting for a 'exclusive row' lock on row 1 page 976604 of the 'BATCH_STEP_EXECUTION' table in database 'pmdb_load' but process (Familyid 0, Spid 1354) already held a 'shared row' lock on it.
Deadlock Id 125: Process (Familyid 0, Spid 1324) was chosen as the victim. End of deadlock information.