[
https://issues.jboss.org/browse/DROOLS-182?page=com.atlassian.jira.plugin...
]
RH Bugzilla Integration commented on DROOLS-182:
------------------------------------------------
Mario Fusco <mfusco(a)redhat.com> made a comment on [bug
995198|https://bugzilla.redhat.com/show_bug.cgi?id=995198]
String drl = "package org.drools.test; \n" +
"import org.drools.Person; \n " +
"global java.util.List list; \n" +
"\n" +
"\n" +
"rule TimeConsumingRule\n" +
"when \n" +
" $p : Person( $n : name ) \n" +
"then \n" +
" System.out.println( Thread.currentThread().getName() + \"Ill continue later
\" ); \n" +
" Thread.sleep( 1000 ); \n" +
" System.out.println( Thread.currentThread().getName() + \"Hello >>
\" + $n );\n" +
"end\n" +
"\n" +
"rule PreemptingRule\n" +
"timer( expr:0 )\n" +
"when\n" +
" $p : Person()\n" +
"then\n" +
" System.out.println( Thread.currentThread().getName() + \"Take out \" + $p
); \n" +
" retract( $p );\n" +
"end\n" +
"\n"
;
This particular test case throws a NPE when the accessor $n tries to read the - retracted
- Person's name. The exception is not thrown when the time is > 0
Timed rules can disrupt other activations as they are being fired
-----------------------------------------------------------------
Key: DROOLS-182
URL:
https://issues.jboss.org/browse/DROOLS-182
Project: Drools
Issue Type: Bug
Security Level: Public(Everyone can see)
Affects Versions: 5.5.1.Final, 6.0.0.Beta3
Reporter: Davide Sottara
Assignee: Mark Proctor
Priority: Blocker
Timer-driven rules are executed by separated thread. One such thread may retract a fact
which is being used by the (main) thread in a rule being fired. This preemption will lead
to a NPE
--
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