jbpm - drools stateless vs stateful session -
when should use drools stateless session , benefits of using instead of stateful session?
in comment here it's said stateless sessions wraps stateful one, means when destory statfeul session after firing rules behave stateful 1 ?
perhaps better both (stateful) kiesession , statelesskiesessions provide apis (interfaces) classes based on class abstractruntime.
a statelesskiesession provides interface executing set of commands via single execute
method call, commands being represented set of objects. useful if want send commands remote session (but not if run session within application). also, such session not react changes done within working memory, usefulness limited, although might perform first , round more efficient stateful session.
an execute
call implies dispose
call, final goodbye session object: release resources garbage collection.
to summarize (what described in full in drools documentation)
- for simple rule evaluations, via remote communication, use stateless session.
- to make use of full power of production system, i.e., continued reevaluation of rule conditions consequence of altered facts , changed fact lineups, necessary use stateful session.
don't worry "benefits" if planning simple application interface: use stateful session.
Comments
Post a Comment