[rules-users] Stateless session dis-associating listeners after first execute call. Bug or a feature?

Michal Bali michalbali at gmail.com
Tue Jan 8 16:22:03 EST 2013


Thanks Mark, Wolfgang,

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
I've created JBRULES-3711 <https://issues.jboss.org/browse/JBRULES-3711>.

Thank you.
Best regards,
Michal

On Sat, Jan 5, 2013 at 5:20 AM, Mark Proctor <mproctor at codehaus.org> wrote:

> each execute creates a new stateful session. All the listers are added to
> that after it's created, see newWorkingMemory:
>
> https://github.com/droolsjbpm/drools/blob/master/drools-core/src/main/java/org/drools/impl/StatelessKnowledgeSessionImpl.java
>
> Mark
> On 4 Jan 2013, at 16:20, Wolfgang Laun <wolfgang.laun at gmail.com> wrote:
>
> > On 04/01/2013, Michal Bali <michalbali at gmail.com> wrote:
> >> Hi Wolfgang,
> >>
> >> I am not calling dispose() as it is not possible to dispose a stateless
> >> session.
> >
> > Which I didn't suggest you'd do.
> >
> >> I've just noticed that it is called automatically by Drools
> >> internal code (when calling StatelessKnowledgeSession.execute(Iterable)
> >> method).
> >
> > And I tried to point out its consequences and the lack of
> > clarification in the Drools docs whether this is the end of life for a
> > StatelessKnowledgeSession.
> >
> > -W
> >
> >>
> >> Thank you for responding.
> >> Best Regards,
> >> Michal
> >>
> >>
> >> On Wed, Dec 26, 2012 at 9:45 AM, Wolfgang Laun
> >> <wolfgang.laun at gmail.com>wrote:
> >>
> >>> tertium non datur
> >>
> > _______________________________________________
> > rules-users mailing list
> > rules-users at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-users
>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20130108/2e8160a3/attachment.html 


More information about the rules-users mailing list