[rules-users] Performance: StatefulKnowledgeSession.dispose()

tonytang baiyuantang at hengtiansoft.com
Mon Oct 24 23:31:35 EDT 2011


I found the problem:
This is because I use log:
KnowledgeRuntimeLogger logger =
KnowledgeRuntimeLoggerFactory.newFileLogger(session, "test");

If I use Stateful session, The rule engine will print many log in XML file.
But if i use stateless session, it will not print any log.

my code is like this one:
for(int i = 0; i < 1000000; i ++){
    session.insert(new Object())// 
    session.fireAllrules();
}
session.dispose();

If I send 1,000,000 message, it will generate hundreds xml format log files.


--
View this message in context: http://drools.46999.n3.nabble.com/Performance-StatefulKnowledgeSession-dispose-tp3447069p3450316.html
Sent from the Drools: User forum mailing list archive at Nabble.com.



More information about the rules-users mailing list