Uploaded image for project: 'JBRULES'
  1. JBRULES
  2. JBRULES-3711

Stateless session dis-associating listeners after first execute call

    Details

      Description

      Hello,

      I am using a stateless session. First I add an agenda event listener. When I first call session.execute(Itelable) all works as expected. However when I call it the second time (without adding the listener again) the listener does not seem to be called at all.
      However note that when I call session.getAgendaEventListeners() the event listener is always there.
      IMHO I am guessing that the 'dispose' method that is called behind the scenes possibly dis-associates the event listener.
      I've tested this with 5.5.Final. BTW This worked fine with Drools 5.0. I haven't checked later versions.
      I wonder is this a bug or a feature?

      Isolated test case is attached.

      Thank you.
      Best regards,
      Michal

      ------------------------
      further testing:

      I had a look at the source code of StatelessKnowledgeSessionImpl.java (from
      https://github.com/droolsjbpm/drools/blob/5.5.0.Final/drools-core/src/main/java/org/drools/impl/StatelessKnowledgeSessionImpl.java )
      It seems that when execute(..) is being called for the first time, the event listeners are being added to this.agendaEventSupport, see line number 136. However when the dispose() method is being called internally by Drools this agendaEventSupport collection is cleared. Then upon further executions (calls to the execute(..) method) the event listeners are no longer added to this.agendaEventSupport and hence they are not being triggered

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                mark.proctor Mark Proctor
                Reporter:
                michalbali Michal Bali
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: