-
Bug
-
Resolution: Done
-
Major
-
1.2.0.Final
-
None
When a transaction timeout occurs in a batch thread running a chunk-type step, the transaction context does not seem to be cleaned up properly. New chunk-type steps cannot be started on the respective thread any more - a server restart is required.
Following exception is thrown when trying to run a chunk-type step in a batch thread that experienced a tx timeout before:
12:10:48,070 INFO [org.jberet.test.StepBoundaryLogger] (Batch Thread - 1) Starting job job 12:10:48,071 INFO [org.jberet.test.StepBoundaryLogger] (Batch Thread - 1) Starting step jobStep 12:10:48,072 TRACE [com.arjuna.ats.jta] (Batch Thread - 1) BaseTransaction.begin 12:10:48,072 TRACE [com.arjuna.ats.jta] (Batch Thread - 1) TransactionImple.getStatus: javax.transaction.Status.STATUS_ROLLEDBACK 12:10:48,076 ERROR [org.jberet] (Batch Thread - 1) item-count=20, time-limit=0, skip-limit=-1, skipCount=0, retry-limit=-1, retryCount=0 12:10:48,076 ERROR [org.jberet] (Batch Thread - 1) JBERET000007: Failed to run job job, jobStep, org.jberet.job.model.Chunk@3a5ab142: javax.transaction.NotSupportedException: BaseTransaction.checkTransactionState - ARJUNA016051: thread is already associated with a transaction! at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.begin(BaseTransaction.java:73) at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.begin(BaseTransactionManagerDelegate.java:78) at org.jberet.runtime.runner.ChunkRunner.run(ChunkRunner.java:187) at org.jberet.runtime.runner.StepExecutionRunner.runBatchletOrChunk(StepExecutionRunner.java:219) at org.jberet.runtime.runner.StepExecutionRunner.run(StepExecutionRunner.java:140) at org.jberet.runtime.runner.CompositeExecutionRunner.runStep(CompositeExecutionRunner.java:164) at org.jberet.runtime.runner.CompositeExecutionRunner.runFromHeadOrRestartPoint(CompositeExecutionRunner.java:88) at org.jberet.runtime.runner.JobExecutionRunner.run(JobExecutionRunner.java:59) at org.wildfly.extension.batch.jberet.impl.BatchEnvironmentService$WildFlyBatchEnvironment$1.run(BatchEnvironmentService.java:243) at org.wildfly.extension.requestcontroller.RequestController$QueuedTask$1.run(RequestController.java:497) at org.jberet.spi.JobExecutor$3.run(JobExecutor.java:161) at org.jberet.spi.JobExecutor$1.run(JobExecutor.java:99) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) at org.jboss.threads.JBossThread.run(JBossThread.java:320) Caused by: java.lang.IllegalStateException: BaseTransaction.checkTransactionState - ARJUNA016051: thread is already associated with a transaction! at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.checkTransactionState(BaseTransaction.java:264) at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.begin(BaseTransaction.java:68) ... 15 more 12:10:48,077 INFO [org.jberet.test.StepBoundaryLogger] (Batch Thread - 1) Step jobStep finished 12:10:48,077 INFO [org.jberet.test.StepBoundaryLogger] (Batch Thread - 1) Job job finished
- is related to
-
JBEAP-4811 (7.0.z) Batch thread tx context not cleaned up properly on tx timeout in chunk-type step
- Verified
- links to