Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-9450

Jbpm7 spring boot business application: No active transaction after arjuna transaction timeout

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Blocker Blocker
    • None
    • 7.41.0.Final
    • Business Apps, KieServer
    • None

      Hello,

      I'm encountering the same problem described here: https://issues.redhat.com/plugins/servlet/mobile#issue/RHBPMS-4621.

      I use jbpm 7.41 business application with oracle database. Under high load, transaction timeouts are detected and arjuna marks them for rollback. Then, Jbpm executor thread reuse the same transaction and throws a repetitive exception "No active transaction...".

      I think that the same fix done for JtaTransactionManager in RHBPMS-4621 is needed for KieSpringTransactionManager.

      Thank you in advance,

        1. jbpm-perfs-oracle.zip
          36 kB
        2. jbpm-perfs-oracle.zip
          34 kB
        3. logs.txt
          50 kB

            [JBPM-9450] Jbpm7 spring boot business application: No active transaction after arjuna transaction timeout

            I am also facing the same issue. Any one found solution to it?

            Vijay Reddy (Inactive) added a comment - I am also facing the same issue. Any one found solution to it?

            Hello,

            We still have the same issue, we tested with the patch in the pull request related to this same Jira ticket https://github.com/kiegroup/droolsjbpm-integration/pull/2880 (version 7.74.0-SNAPSHOT), but we still have the same error after few minutes with high load; then the server just freezes until we restart it.

            Find bellow the error that keeps repeating in the logs.

            2023-06-09 19:43:33.012  WARN 1 --- [ool-6-thread-19] o.j.executor.impl.AvailableJobsExecutor  : Unexpected error while processin executor's job javax.persistence.TransactionRequiredException: Explicitly joining a JTA transaction requires a JTA transaction be currently activejava.lang.RuntimeException: javax.persistence.TransactionRequiredException: Explicitly joining a JTA transaction requires a JTA transaction be currently active
                    at org.kie.spring.jbpm.services.SpringTransactionalCommandService.execute(SpringTransactionalCommandService.java:79) ~[kie-spring-7.73.0.Final.jar!/:7.73.0.Final]
                    at org.jbpm.executor.impl.jpa.ExecutorQueryServiceImpl.getRequestForProcessing(ExecutorQueryServiceImpl.java:224) ~[jbpm-executor-7.73.0.Final.jar!/:7.73.0.Final]
                    at org.jbpm.executor.impl.AvailableJobsExecutor.executeJob(AvailableJobsExecutor.java:31) ~[jbpm-executor-7.73.0.Final.jar!/:7.73.0.Final]
                    at org.jbpm.executor.impl.concurrent.PrioritisedRunnable.run(PrioritisedRunnable.java:47) ~[jbpm-executor-7.73.0.Final.jar!/:7.73.0.Final]
                    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[na:na]
                    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[na:na]
                    at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[na:na]
                    at org.jbpm.executor.impl.concurrent.PrioritisedScheduledFutureTask.run(PrioritisedScheduledFutureTask.java:41) ~[jbpm-executor-7.73.0.Final.jar!/:7.73.0.Final]
                    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
                    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
                    at java.base/java.lang.Thread.run(Thread.java:829) ~[na:na]
            Caused by: javax.persistence.TransactionRequiredException: Explicitly joining a JTA transaction requires a JTA transaction be currently active
                    at org.hibernate.internal.SessionImpl.joinTransaction(SessionImpl.java:3649) ~[hibernate-core-5.4.32.Final.jar!/:5.4.32.Final]
                    at org.hibernate.internal.SessionImpl.joinTransaction(SessionImpl.java:3634) ~[hibernate-core-5.4.32.Final.jar!/:5.4.32.Final]
                    at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.doJoinTransaction(ExtendedEntityManagerCreator.java:378) ~[spring-orm-5.3.13.jar!/:5.3.13]
                    at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:345) ~[spring-orm-5.3.13.jar!/:5.3.13]
                    at com.sun.proxy.$Proxy137.joinTransaction(Unknown Source) ~[na:na]
                    at org.jbpm.shared.services.impl.JpaPersistenceContext.joinTransaction(JpaPersistenceContext.java:229) ~[jbpm-shared-services-7.73.0.Final.jar!/:7.73.0.Final]
                    at org.jbpm.shared.services.impl.TransactionalCommandService.execute(TransactionalCommandService.java:75) ~[jbpm-shared-services-7.73.0.Final.jar!/:7.73.0.Final]
                    at org.kie.spring.jbpm.services.SpringTransactionalCommandService.execute(SpringTransactionalCommandService.java:74) ~[kie-spring-7.73.0.Final.jar!/:7.73.0.Final]
                    ... 10 common frames omitted
            

            Have you been able to reproduce/correct the issue ? is it planned for next release?

            Thanks in advance,

            Abdellah Waali (Inactive) added a comment - - edited Hello, We still have the same issue, we tested with the patch in the pull request related to this same Jira ticket https://github.com/kiegroup/droolsjbpm-integration/pull/2880 (version 7.74.0-SNAPSHOT) , but we still have the same error after few minutes with high load; then the server just freezes until we restart it. Find bellow the error that keeps repeating in the logs. 2023-06-09 19:43:33.012  WARN 1 --- [ool-6-thread-19] o.j.executor.impl.AvailableJobsExecutor  : Unexpected error while processin executor's job javax.persistence.TransactionRequiredException: Explicitly joining a JTA transaction requires a JTA transaction be currently activejava.lang.RuntimeException: javax.persistence.TransactionRequiredException: Explicitly joining a JTA transaction requires a JTA transaction be currently active         at org.kie.spring.jbpm.services.SpringTransactionalCommandService.execute(SpringTransactionalCommandService.java:79) ~[kie-spring-7.73.0.Final.jar!/:7.73.0.Final]         at org.jbpm.executor.impl.jpa.ExecutorQueryServiceImpl.getRequestForProcessing(ExecutorQueryServiceImpl.java:224) ~[jbpm-executor-7.73.0.Final.jar!/:7.73.0.Final]         at org.jbpm.executor.impl.AvailableJobsExecutor.executeJob(AvailableJobsExecutor.java:31) ~[jbpm-executor-7.73.0.Final.jar!/:7.73.0.Final]         at org.jbpm.executor.impl.concurrent.PrioritisedRunnable.run(PrioritisedRunnable.java:47) ~[jbpm-executor-7.73.0.Final.jar!/:7.73.0.Final]         at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[na:na]         at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[na:na]         at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[na:na]         at org.jbpm.executor.impl.concurrent.PrioritisedScheduledFutureTask.run(PrioritisedScheduledFutureTask.java:41) ~[jbpm-executor-7.73.0.Final.jar!/:7.73.0.Final]         at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]         at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]         at java.base/java.lang. Thread .run( Thread .java:829) ~[na:na] Caused by: javax.persistence.TransactionRequiredException: Explicitly joining a JTA transaction requires a JTA transaction be currently active         at org.hibernate.internal.SessionImpl.joinTransaction(SessionImpl.java:3649) ~[hibernate-core-5.4.32.Final.jar!/:5.4.32.Final]         at org.hibernate.internal.SessionImpl.joinTransaction(SessionImpl.java:3634) ~[hibernate-core-5.4.32.Final.jar!/:5.4.32.Final]         at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.doJoinTransaction(ExtendedEntityManagerCreator.java:378) ~[spring-orm-5.3.13.jar!/:5.3.13]         at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:345) ~[spring-orm-5.3.13.jar!/:5.3.13]         at com.sun.proxy.$Proxy137.joinTransaction(Unknown Source) ~[na:na]         at org.jbpm.shared.services.impl.JpaPersistenceContext.joinTransaction(JpaPersistenceContext.java:229) ~[jbpm-shared-services-7.73.0.Final.jar!/:7.73.0.Final]         at org.jbpm.shared.services.impl.TransactionalCommandService.execute(TransactionalCommandService.java:75) ~[jbpm-shared-services-7.73.0.Final.jar!/:7.73.0.Final]         at org.kie.spring.jbpm.services.SpringTransactionalCommandService.execute(SpringTransactionalCommandService.java:74) ~[kie-spring-7.73.0.Final.jar!/:7.73.0.Final]         ... 10 common frames omitted Have you been able to reproduce/correct the issue ? is it planned for next release? Thanks in advance,

            Clinton Gomes (Inactive) added a comment - - edited

            mfusco@redhat.com - we still  have this issue in JBPM 7.54, spring-boot with Oracle db

            Even low loads and shorter transactions like complete task (a few seconds), will sometimes give this error: "Explicitly joining a JTA transaction requires a JTA transaction".

            was going to set defaultAutoCommit to false for dbcp. Do you have any suggestion on how to fix this issue?

            DBCP props Ref: https://commons.apache.org/proper/commons-dbcp/configuration.html

            Clinton Gomes (Inactive) added a comment - - edited mfusco@redhat.com - we still  have this issue in JBPM 7.54, spring-boot with Oracle db Even low loads and shorter transactions like complete task (a few seconds), will sometimes give this error: "Explicitly joining a JTA transaction requires a JTA transaction". was going to set defaultAutoCommit to false for dbcp. Do you have any suggestion on how to fix this issue? DBCP props Ref: https://commons.apache.org/proper/commons-dbcp/configuration.html

            Hello,

            We are experiencing the same issue.  Has there been any movement on this ticket or any resolution?

            Matt Saigeon (Inactive) added a comment - Hello, We are experiencing the same issue.  Has there been any movement on this ticket or any resolution?

            Hello,
            I updated the reproducer project "jbpm-perfs-oracle.zip" by adding missing workItemHandlers.

            Thank you for your help,

            AZZANA Youssef (Inactive) added a comment - Hello, I updated the reproducer project "jbpm-perfs-oracle.zip" by adding missing workItemHandlers. Thank you for your help,

            I attached a sample project to reproduce the problem ( jbpm-perfs-oracle.zip ). It consists of a business application with a simple process containing only 2 tasks.

            I use asynchronous executor with a simple command throwing exception. I start processes using Jmeter (jmx file is in the zip also), the processes execute normally but as soon as Arjuna Transaction Reaper cancels a transaction, the executor threads will throw the same exception "Explicitly joining a JTA transaction requires a JTA transaction".

            The logs are attached: logs.txt

            Thank you for your help.

            AZZANA Youssef (Inactive) added a comment - - edited I attached a sample project to reproduce the problem ( jbpm-perfs-oracle.zip ). It consists of a business application with a simple process containing only 2 tasks. I use asynchronous executor with a simple command throwing exception. I start processes using Jmeter (jmx file is in the zip also), the processes execute normally but as soon as Arjuna Transaction Reaper cancels a transaction, the executor threads will throw the same exception "Explicitly joining a JTA transaction requires a JTA transaction". The logs are attached: logs.txt Thank you for your help.

              elguardian@gmail.com Enrique González Martínez (Inactive)
              youssef.azzana AZZANA Youssef (Inactive)
              Votes:
              3 Vote for this issue
              Watchers:
              9 Start watching this issue

                Created:
                Updated: