Hi,
I am facing an issue with Drools Query.
Our application serializes working memory after its each execution, to save
the rule engine state.
Our rule base contains a Query along with other rules:
query "GetFactsByValue" ( String $value )
Facts : DataObject( stringValue == $value )
end
With this query present in Rule Base, if I insert more then 900 instances of
DataObject & then try to serialize the working memory... serialization fails
with bellow error:
java.lang.StackOverflowError
at java.io.ObjectStreamClass.processQueue(Unknown Source)
at java.io.ObjectStreamClass.lookup(Unknown Source)
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
But if I remove the query from rule base, I can insert more then 60,000
objects & then serialize WM without any problem.
Not sure if this is a bug in Query feature or problem in the way I have
written the Query. I have attached test files.
We are using few more queries in our RuleBase like:
query "GetAllFacts" ( )
Fact : DataObject( )
end
query "GetFactsByDate" ( Calendar $startDate, Calendar $endDate )
Fact : DataObject( startDate >= $startDate, endDate <= $endDate )
end
query "GetFactsByParamIdTimeRange" ( ArrayList $paramIDs, Calendar
$startDate, Calendar $endDate )
Facts : DataObject( paramID memberOf $paramIDs, startDate >= $startDate,
endDate <= $endDate )
end
Not sure if they also may fail in some special scenarios. Atleast last 3
Queries we are planning to use in our production. Is it ok to use those?
Execution Environment:
OS: Windows/ Solaris
Drools 4.0.7
jre1.5.0_09
Thanks
Siddhartha
Show replies by date