3 Replies Latest reply on Mar 8, 2010 5:58 AM by Paolo F


    Paolo F Newbie


           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?



        • 1. Re: HistoryService
          Maciej Swiderski Master

          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...




          • 2. Re: HistoryService
            Paolo F Newbie



            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,


            • 3. Re: HistoryService
              Paolo F Newbie

              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:


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


              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.