5 Replies Latest reply on Mar 17, 2009 5:55 AM by aguizar

    best way to clean jbpm db

    bestage

      What would be th ebest way to clean the jbpm database?

      my idea is:

      to delete all process instance objects and then the process definition itself.

      I would like to give this possibility to the application admins to be more flexible.

        • 1. Re: best way to clean jbpm db
          kukeltje

          never tried it, but using hibernate, it might be that if you delete a processdefinition, all corresponding instances are removed as well

          • 2. Re: best way to clean jbpm db
            bestage

             

            "kukeltje" wrote:
            never tried it, but using hibernate, it might be that if you delete a processdefinition, all corresponding instances are removed as well


            I tried this. It's no working. hibernate throws exceptions. I suppose you cannot delete a process definition which has some or at least one process instance that hasn't ended.

            So now I am trying to delete the process instances first and to force-end first those not ended. After that I'll try to delete the process def itself.

            I will post the result here.

            • 3. Re: best way to clean jbpm db
              bestage

              as I supposed it is working:



              - for all instances of a process definition

              1. suspend process instance
              2. delete process instance

              - when done, delete the process definition (version xx)

              • 4. Re: best way to clean jbpm db
                kukeltje

                and what if you do delete the definition with hibernate AFTER you ended all running instances

                • 5. Re: best way to clean jbpm db
                  aguizar

                  In 3.2.6 the call GraphSession.deleteProcessDefinition() will delete all process instances, then delete the process definition. Do not expect it to be too fast, tough.