I’ve got a problem where creating new drools StatefulKnowledgeSession instances is CPU intensive. There’s an old nabble link that talks about it here. I’m not sure how I’d work around it, so I figured I’d create a pool of them. So far, I’m completely unable to find out if they are reusable or not. I know they aren’t multithread safe in the sense of having 2 threads running rules at the same time, but can I reuse a session in a new thread later down the line after the last usage has called dispose()?
I’ve got a problem where creating new drools StatefulKnowledgeSession instances is CPU intensive. There’s
Share
I ended up creating a single KnowledgeSessionConfiguration and reusing that with every creation of a KnowledgeSession. For whatever reason (apparently a large classpath), creating the configuration was extremely expensive for me, just like the article I linked. I’m not sure what I lose by creating the KnowledgeSessionConfiguration just once and reusing it. Everything seems to be behaving normally.