[jboss-jira] [JBoss JIRA] (JBRULES-3711) Stateless session dis-associating listeners after first execute call
Michal Bali (JIRA)
jira-events at lists.jboss.org
Tue Jan 8 16:18:08 EST 2013
Michal Bali created JBRULES-3711:
------------------------------------
Summary: Stateless session dis-associating listeners after first execute call
Key: JBRULES-3711
URL: https://issues.jboss.org/browse/JBRULES-3711
Project: JBRULES
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-core (expert)
Affects Versions: 5.5.0.Final
Reporter: Michal Bali
Assignee: Mark Proctor
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
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list