Interupting Stateful session

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Interupting Stateful session

glambert27
Hi,
I have a project that requires the use of stateful sessions. Upwards of 70K facts are inserted into the session. As a result the running time for the rules to run is upwards of 10-15mins. I need a way to have the user cancel the running rule process. Using a listener perhaps? I've attached my rule file sanitized to protect the innocent. sanitized_rules.drl

I'd appreciate any help or incite. maybe some help in getting my rules to run faster as well.
Reply | Threaded
Open this post in threaded view
|

Re: [rules-users] Interupting Stateful session

laune
Why not simply interrupt the thread running the engine?
-W

On 30/12/2013, glambert27 <[hidden email]> wrote:

> Hi,
> I have a project that requires the use of stateful sessions. Upwards of 70K
> facts are inserted into the session. As a result the running time for the
> rules to run is upwards of 10-15mins. I need a way to have the user cancel
> the running rule process. Using a listener perhaps? I've attached my rule
> file sanitized to protect the innocent.  sanitized_rules.drl
> <http://drools.46999.n3.nabble.com/file/n4027464/sanitized_rules.drl>
>
> I'd appreciate any help or incite. maybe some help in getting my rules to
> run faster as well.
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Interupting-Stateful-session-tp4027464.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/rules-users
>
_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users
Reply | Threaded
Open this post in threaded view
|

Re: [rules-users] Interupting Stateful session

glambert27
actually, I think session.halt() will solve my problem. I'll update shortly
Reply | Threaded
Open this post in threaded view
|

Re: [rules-users] Interupting Stateful session

laune
On 31/12/2013, glambert27 <[hidden email]> wrote:
> actually, I think session.halt() will solve my problem. I'll update shortly

Only if you have a good way of knowing when the work is done, to call
halt() when there is no user interrupt. halt() was not invented for
permitting an asynchronous interrupt of an Engine run.

-W

>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Interupting-Stateful-session-tp4027464p4027469.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/rules-users
>
_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users
Reply | Threaded
Open this post in threaded view
|

Re: [rules-users] Interupting Stateful session

glambert27
So I went with:
ksession.halt();
ksession.clearAgenda();
ksession.dispose();
       
is this not an ideal solution?
Reply | Threaded
Open this post in threaded view
|

Re: [rules-users] Interupting Stateful session

laune
Good enough. Documentation says that the currently executing
rule is terminated, but I guess that's preferable to a harsh interrupt.
Still, depending on what is being done in RHS code, it doesn't
guarantee a consistent end - but a more radical interrupt will even
be worse.
-W

On 31/12/2013, glambert27 <[hidden email]> wrote:

> So I went with:
> ksession.halt();
> ksession.clearAgenda();
> ksession.dispose();
>
> is this not an ideal solution?
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Interupting-Stateful-session-tp4027464p4027480.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/rules-users
>
_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users