3 Replies Latest reply on Jan 11, 2010 5:49 AM by jbarrez

    jBPM v3 - short transactions

      Hi,

       

      I was wondering about possibility to make jBPM transaction shorter. As far as I know the default aproach is to commit while closing jbpmContext. On the other hand, we're running processes with large number of automatic steps placed at the beginning of process and few manual steps placed at the end of process flow. We're creating process instance, saving it and signalling. Process executes all automatic steps and fails on manual step. Then, all operations are rolled back to start state. From our point of view it would be better to perform commit on node-leave event for each automatic step. When process fails on manual step it will be rolled back to last successfull operation, not to the beginning of process. Of course that aproach has some disadvantages but in general we're handling shorter and simpler transactions.

      Now my question: Is it possible to achieve that behaviour of JBPM and if someone tried it ?

        • 1. Re: jBPM v3 - short transactions
          jbarrez

          An option could be to make all the automatic steps async. That way, they'll all be done in small, separate transaction.

           

          Consequence is that you're losing the synchronous invocation (ie you don't know where your process is after the return of the invocation).

          • 2. Re: jBPM v3 - short transactions

            jbarrez wrote:

             

            Consequence is that you're losing the synchronous invocation (ie you don't know where your process is after the return of the invocation).

             

            You mean that I'm loosing control after signal and let the process running as far as possible ? Or I'm missing something ?

            • 3. Re: jBPM v3 - short transactions
              jbarrez
              No, what I meant was that when you do a signal() operation, the method will return immediately. But you don't know where exactly your process will be next time you do an operation, since the process is handled asynchronously (in a separate thread)