[
https://jira.jboss.org/jira/browse/JBRULES-1432?page=com.atlassian.jira.p...
]
Mark Proctor updated JBRULES-1432:
----------------------------------
Summary: Thread safe queries (was: Queries Executed while Rules are Firing Causes
Exceptions)
Thread safe queries
-------------------
Key: JBRULES-1432
URL:
https://jira.jboss.org/jira/browse/JBRULES-1432
Project: Drools
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: drools-core (expert)
Affects Versions: 4.0.4
Environment: Sun 1.5.0_04 Windows
Reporter: Steve Shabino
Assignee: Mark Proctor
Fix For: 5.1.0.M2
We have a stateful WM into which we periodically (1) insert new facts and fire rules, and
(2) execute queries. Drools fails when we allow query execution in another thread during
fireAllRules().
Set-up:
- Every 10 seconds, Thread A inserts some facts and calls fireAllRules(). fireAllRules()
is never called concurrently with itself.
- Thread B executes many getQueryResults() calls in series (no concurrency in query
execution)
Our rule base uses shadow facts for all facts and is set up this way:
conf.setAssertBehaviour(RuleBaseConfiguration.AssertBehaviour.EQUALITY);
conf.setRemoveIdentities(true);
conf.setLogicalOverride(RuleBaseConfiguration.LogicalOverride.DISCARD);
conf.setMaintainTms(true);
conf.setShadowProxy(true);
We are making some use of insertLogical().
Expected:
- Queries are run against the last consistent truth state, even while fireAllRules() is
running.
Actual Behavior:
We get this exception:
Caused by: java.lang.RuntimeException: Unable to pop
at org.drools.util.PrimitiveLongStack.pop(PrimitiveLongStack.java:63)
at
org.drools.common.AbstractFactHandleFactory.newFactHandle(AbstractFactHandleFactory.java:44)
at org.drools.reteoo.ReteooWorkingMemory.getQueryResults(ReteooWorkingMemory.java:90)
This bug occurs under 4.04 and 4.1 Trunk as of 1/22.
Please let us know if we can provide additional information.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira