[rules-users] Implementing Timers With Drools Persistence Enabled

Tan Hui Onn huionn at gmail.com
Tue Jul 13 07:49:57 EDT 2010


Hi Nick,

You are absolutely right that the timer is not triggered in
CommandBasedStatefulKnowledgeSession (which is used for JPA
persistence). I have spent some time to troubleshoot it. There is some
finding regarding to this problem. Maybe other experts are willing to
solve it.

In org.drools.persistence.processinstance.JPASignalManager, when the
signal is triggered in method
signalEvent(long processInstanceId,
                            String type,
                            Object event),
the thread is blocked in
    >> commandService.execute(command);

I used debugger to trace it, and found that
SingleSessionCommandService.execute(GenericCommand<T>) is
synchronized.


I think the cause of untriggered timer is due to blocked
"commandService.execute(command)" in JPASignalManager.

(I am using drools-5.1.0.M2)
On Tue, Jul 13, 2010 at 6:09 AM, nanic23 <nanic23 at hotmail.com> wrote:
>
> Hi cafebabe,
>
> Thanks for your comment. I agree with you that work item ids are database
> primary keys but in this simple (very simple) case I just decided to
> harcoded as I know for a fact that the work item id is 1 because that is the
> only work item and each time I run the test the tables are dropped and
> recreated. So, there is never more than one row in the workItemInfo table
> and the only row always has 1 as its id.
> I could have stored the work item id or a work item object as a variable
> (like you mentioned) but in this case wouldn't make a difference for the
> timers.
>
> Are timers working for you when you use persistence? I do complete work
> items by workItem.getId() in all my code (other than this simple example
> :)). My problem is NOT completing the work item, my problem is triggering
> timers when persistence is enabled. The timers don't even trigger, thing
> that should happen before even trying to complete the work item.
>
> Thanks,
>
> Nick.
>
>
> --
> View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Implementing-Timers-With-Drools-Persistence-Enabled-tp923142p961658.html
> Sent from the Drools - User mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



More information about the rules-users mailing list