3 Replies Latest reply on Mar 8, 2010 5:58 AM by emp.tyres

    HistoryService

      Hullo,

           anyone ever had issues with an application that works 100% OK, but when calling HistoryService queries only gets zero results?

       

           This is probably not an issue in the "JIRA" sense, rather I am looking for something arcane I may be overlooking. I am using 4.3 on a mem: hsqldb db, wrapped the ProcessEngine into a signleton, and accessing it from an application being tested with plain Junit TestCases. Everything running smooth as expected, except for ProcessInstanceQueries and ActivityInstanceQueries consistently returning an empty list.

       

           I tried turning autocommit to true (the only hint in that direction I coudl find) in the hibernate config file, to no avail.

       

           Anyone that ever experienced a similar problem has any hints as to what I should be double-checking?

       

      TIA

        • 1. Re: HistoryService
          swiderski.maciej

          Did you try to enable logging for Hibernate to check if Hibernate is issuing queries?

           

          I have similar setup and there are no problems with running history queries. Perhaps you could past a unit test...

           

          Cheers,

          Maciej

          • 2. Re: HistoryService

            Maciej,

             

            thanks very very much for the hint - activating hibernate logging results in two queries being issued against tables JBPM4_HIST_PROCINST and JBPM4_HIST_ACTINST when asking for the process and activity instances.

             

              However, to the best of my understanding, no inserts or updates ever get fired in the course of the execution. It seems I somehow managed to disable history completely . Any hints about how I could possibly have done this?

             

               <history-service /> is in jbpm.default.cfg and I am not sure what else I could be checking...

             

              Bye and TIA,


            Emp

            • 3. Re: HistoryService

              For the record, I found the issue, largely thanks to Maciej's suggestion of looking at the hibernate log, which pointed me in the right direction (tables OK, nothing logged).

               

              I apparently had carried over a jbpm.default.cfg.xml file from an older (4.0?) version, and that version did NOT have the following lines:

               

                  <history-sessions>
                    <object class="org.jbpm.pvm.internal.history.HistorySessionImpl" />
                  </history-sessions>

               

              This apparently (correctly) causes all calls to the history service to succeed, without anything getting recorded. So, for anyone out there, if you find yourself with getHistoryService().createHistoryProcessInstanceQuery().list() or getHistoryService().createHistoryActivityInstanceQuery().list() returning zero results, I suggest you check your jbpm.default.cfg.xml file.

               

              Bye,


              Emp