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

Wolfgang Laun wolfgang.laun at gmail.com
Wed Dec 26 04:45:43 EST 2012


>From the Javadoc of dispose() (quote: "Releases all [...] resources,
setting up the session for garbage collection") I derived the notion
that dispose is the last goodbye to any session object, so that it
can't be used any more. Just removing all facts and thereby all
activations based on the presences of facts and recreating all
activations merely based on "eval(true)" would be more like a
description for returning a session to its initial state, which is
what you need, in general, for re-using any session.

Does the session produce anything at all during the second execute()?

If "dispose()" really is the end, another execute() should result in
an exception; if there is no exception, it should function correctly -
tertium non datur ;-)

-W

On 25/12/2012, Michal Bali <michalbali at gmail.com> wrote:
> 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
>


More information about the rules-users mailing list