Uploaded image for project: 'Red Hat Decision Manager'
  1. Red Hat Decision Manager
  2. RHDM-1796

Reset FactHandleId on KieSession.dispose

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Done
    • Icon: Major Major
    • 7.12.0.GA
    • 7.11.1.GA
    • BRE
    • False
    • False
    • Release Notes
    • ER1
    • +
    • undefined
    • 2021 Week 31-33 (from Aug 2)

      While upgrading from RHDM 7.8 to 7.10 (Drools 7.39.x to 7.48.x) we noticed a change to the FactHandleId values when disposing a KieSession instance and creating a new one.

      For audit purposes during our test runs, we configure a RuleRuntimeEventListener to capture the facts details:

      ksession.addEventListener(new DefaultRuleRuntimeEventListener() {
         public void objectInserted(ObjectInsertedEvent event) {
            InternalFactHandle ifh = (InternalFactHandle) event.getFactHandle();
            System.out.println("Object inserted. ID=" + ifh.getId());
         }
      });
      

      In 7.39.x release, if we dispose kiesession, factHandler reset:

      Object inserted. ID=1
      Hello World
      Object inserted. ID=2
      New kie-session generated
      Object inserted. ID=1
      Hello World
      Object inserted. ID=2
      

      But with 7.48.x release, it keep increasing:

      Object inserted. ID=1
      Hello World
      Object inserted. ID=2
      New New kie-session generated
      Object inserted. ID=3
      Hello World
      Object inserted. ID=4
      

      Is there a way to reconfigure the fact ids to reset to 1 for each new ksession?

              lmolteni@redhat.com Luca Molteni
              rhn-support-mputz Martin Weiler (Inactive)
              Paolo Bizzarri Paolo Bizzarri
              Paolo Bizzarri Paolo Bizzarri
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: