Bug 729915 - Methods called on disposed knowledge session should throw an exception
Summary: Methods called on disposed knowledge session should throw an exception
Keywords:
Status: VERIFIED
Alias: None
Product: JBoss Enterprise BRMS Platform 5
Classification: JBoss
Component: BRE (Expert, Fusion)
Version: 5.1.0 GA,BRMS 5.2.0-ER1
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: BRMS 5.3.0.GA
Assignee: Edson Tirelli
QA Contact: Tomas Schlosser
URL:
Whiteboard:
Depends On:
Blocks: 734762
TreeView+ depends on / blocked
 
Reported: 2011-08-11 09:28 UTC by Tomas Schlosser
Modified: 2012-05-03 02:15 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
An error occurred where inserting facts into a disposed stateful knowledge session should result in an exception being thrown, however, no exception was thrown. This has been resolved and the illegalStateException is now thrown when inserting facts into a disposed stateful knowledge session.
Clone Of:
Environment:
Last Closed:
Type: Bug


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
JBoss Issue Tracker JBRULES-1880 None Closed Can fire rules after disposing the Stateful session 2012-05-30 05:21:22 UTC

Description Tomas Schlosser 2011-08-11 09:28:25 UTC
Description of problem:
When you try to run a simple code (see the end of description) where you insert facts into disposed stateful knowledge session you get no exception warning you that you are using disposed session. However it works (fact is inserted, rules fire) the bug is that it doesn't work with named entry points. If you try inserting event into entry point you get NullPointerException:
java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:1956) 
at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:816) 
at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute(ScheduledThreadPoolExecutor.java:299) 
at java.util.concurrent.ScheduledThreadPoolExecutor.schedule(ScheduledThreadPoolExecutor.java:478) 
at org.drools.time.impl.JDKTimerService.schedule(JDKTimerService.java:114) 
at org.drools.time.impl.JDKTimerService.scheduleJob(JDKTimerService.java:80) 
at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:205) 
at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:145) 
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:176) 
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:145) 
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:96) 
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:44) 
at org.jboss.qa.drools.features.cep.EventLifecycleTest.testManagedLifecycle(EventLifecycleTest.java:130)


Additional info:
StatefulKnowledgeSession session = kbase.newStatefulKnowledgeSession();
session.insert("hello world");
session.fireAllRules();

session.dispose();

session.insert("goodbye world");
session.fireAllRules();
ksession.getWorkingMemoryEntryPoint("EventStream").insert("this one throws NPE");

Comment 1 Anne-Louise Tangring 2011-08-12 15:06:41 UTC
Border line enhancment request.

Comment 3 Mark Proctor 2012-01-19 01:24:24 UTC
We'll generate a proxy that throws exceptions when used.

Comment 4 Edson Tirelli 2012-01-19 23:27:23 UTC
This was fixed at the same time as https://bugzilla.redhat.com/show_bug.cgi?id=734762

Comment 6 Tomas Schlosser 2012-01-30 14:28:45 UTC
It is fixed now. Thank you

Comment 7 lcarlon 2012-05-03 02:15:41 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
An error occurred where inserting facts into a disposed stateful knowledge session should result in an exception being thrown, however, no exception was thrown. This has been resolved and the illegalStateException is now thrown when inserting facts into a disposed stateful knowledge session.


Note You need to log in before you can comment on or make changes to this bug.