2 Replies Latest reply on Aug 7, 2014 5:53 AM by razeetg

    Custom scheduler and transaction issues

    razeetg

      Hello everyone, I created a custom Scheduler Service that implements GlobalSchedulerService. It uses quartz similar to QuartzSchedulerService. However, when the timer expires, instead of running the TimerJobInstance callable, it puts the Callable into a JMS queue and is executed by an MDB. However, when it is executed in the MDB, it executes fine, but the MDB throws a transaction error. I think the callable commits the transaction before it returns from the MDB. Can the callable made to not commit transactions? Thanks.

        • 1. Re: Custom scheduler and transaction issues
          swiderski.maciej

          as long as MDB will own transaction jbpm should not commit transaction itself. What error do you get - do you have stacktrace?

           

          HTH

          • 2. Re: Custom scheduler and transaction issues
            razeetg

            Maciej, the stack trace is here: http://pastebin.com/fvan4Rxd.

             

            The following is the summary of the stack trace:

             

            14:56:23,367 INFO  [stdout] (Thread-0 (HornetQ-client-global-threads-612283983)) WARN  org.drools.persistence.SingleSessionCommandService: Could not commit session

            14:56:23,367 INFO  [stdout] (Thread-0 (HornetQ-client-global-threads-612283983)) java.lang.IllegalArgumentException: Removing a detached instance org.drools.persistence.info.SessionInfo#6568

             

            further down the stack trace, it also has:

             

            14:56:23,395 WARN  [com.arjuna.ats.arjuna] (Thread-0 (HornetQ-client-global-threads-612283983)) ARJUNA012125: TwoPhaseCoordinator.beforeCompletion - failed for SynchronizationImple< 0:ffffac1d8fc1:-208fb00c:53e34565:1a9e, org.drools.persistence.jta.JtaTransactionSynchronizationAdapter@52bb305a >: java.lang.IllegalArgumentException: Removing a detached instance org.drools.persistence.info.SessionInfo#6568

                    at org.hibernate.ejb.event.EJB3DeleteEventListener.performDetachedEntityDeletionCheck(EJB3DeleteEventListener.java:67) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]

             

            The MDB has no explicit transaction annotation. The same MDB also processes async work item handlers and that works fine. However, there is a slight difference in that completeWorkItemHander is called through another EJB.