Can i use drools in multithreaded environment?

View: New views
7 Messages — Rating Filter:   Alert me  

Can i use drools in multithreaded environment?

by Barath () :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

While doing a load test with jmeter,my web service application with drools works fine for few clients(5 simultaneous hits for 10 times)
but when i increase my clients(120 simultanious hits for 100 times) i am gettin the following exception for
few client, (out of 12,000 hits 200 throws this exception)

problem encountered at node [11] 5{170,189}: unable to resolve property: null pointer exception in property: declr.identifier
org.mvel.TemplateInterpreter.execute(TemplateInterpreter.java:528)
org.mvel.TemplateInterpreter.parse(TemplateInterpreter.java:341)
org.drools.rule.builder.dialect.java.AbstractJavaBuilder.generatTemplates(AbstractJavaBuilder.java:113)
org.drools.rule.builder.dialect.java.JavaConsequenceBuilder.build(JavaConsequenceBuilder.java:95)
org.drools.rule.builder.RuleBuilder.build(RuleBuilder.java:67)
org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:446)
org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:304)
org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:167)
com.drools.util.RuleEngine.applyRule(RuleEngine.java:47)
com.drools.util.DroolsController.getAdvertisement(DroolsController.java:94)
com.drools.util.DroolsController.routeBusinessMethod(DroolsController.java:67)
com.drools.util.DroolsController.getAdvertisement(DroolsController.java:43)
com.drools.MyEndpoint.getAdvertisement(MyEndpoint.java:237)
com.drools.MyEndpoint.process(MyEndpoint.java:144)
org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:489)
org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:441)
org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(BaseLifeCycle.java:46)
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:595)
org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:174)
org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:176)
org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
java.lang.Thread.run(Thread.java:619)

drl file has 6 rules,
5 rules                   - which retract facts which passes the rule.
1 rule(low salience)  - will add the fact to java.util.List (set as global) which passes the rule.

1 . Am i getting this error bcoz of the global list? or any other reason?
2 . How to solve this problem?

here the rules,


global java.util.List feasibleAdv;

rule " percentage rule "  
    when
        $adv : Advertisement( percentageLimit != 0 , percentageLimit < playedPercentage )            
    then
    System.out.println("remove this adv (failed percentage): "+$adv.getAdvertisementID());              
        retract($adv);
end

rule "per day rule"
    when
        $adv : Advertisement( limitperday != 0 , limitperday <= playedperday )        
    then                
        //System.out.println("remove this adv (failed day): "+$adv.getAdvertisementID());
        retract($adv);        
end

rule "per week rule"
    when
        $adv : Advertisement( limitperweek != 0 , limitperweek <= playedperweek)        
    then        
        //System.out.println("remove this adv (failed week): "+$adv.getAdvertisementID());
        retract($adv);                  
end

rule "per month rule"
    when
        $adv : Advertisement( limitpermonth != 0 , limitpermonth <= playedpermonth)        
    then                
        //System.out.println("remove this adv (failed month) : "+$adv.getAdvertisementID());
        retract($adv);                  
end

rule "total played rule"
    when
        $adv : Advertisement( totallimit != 0 , totallimit <= totalplayed )        
    then                
        //System.out.println("remove this adv (failed total played) : "+$adv.getAdvertisementID());
        retract($adv);                  
end


rule "advertisement select rule"
salience -1
        when
                $adv : Advertisement( $playedPercentPerAdvertisement : playedPercentPerAdvertisement)
                not( Advertisement( playedPercentPerAdvertisement < $playedPercentPerAdvertisement ) )
                $advertisementCount : Integer()
        then
                boolean status = true;
                if($advertisementCount-1 < 0){
                        //System.out.println("halted");
                        status = false;
                        drools.halt();
                }
                if(status){
                        feasibleAdv.add($adv);
                        drools.update( drools.getWorkingMemory().getFactHandle($advertisementCount), new Integer($advertisementCount-1) );
                        retract($adv);
                }
end

Thanks,
~Barath.

Re: Can drools work in multithreaded environment?

by Edson Tirelli-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


   Barath,

   What version of drools are you using?

   The drools rulebase is designed to be shared among multiple threads. The working memory (session) is not.
   Having said that, we had a couple bugs in the past regarding multi-thread environments, and so you must use 4.0.7 version that is about to be released. For you test, while you wait for the official release, you can checkout the code and built it from here:

http://anonsvn.labs.jboss.com/labs/jbossrules/branches/4.0.x/

   []s
   Edson

2008/5/5 Barath <barathguna@...>:

Hi,

While doing a load test with jmeter,my web service application with drools
works fine for few clients(5 simultaneous hits for 10 times)
but when i increase my clients(120 simultanious hits for 100 times) i am
gettin the following exception for
few client, (out of 12,000 hits 200 throws this exception)

problem encountered at node [11] 5{170,189}: unable to resolve property:
null pointer exception in property: declr.identifier
org.mvel.TemplateInterpreter.execute(TemplateInterpreter.java:528)
org.mvel.TemplateInterpreter.parse(TemplateInterpreter.java:341)
org.drools.rule.builder.dialect.java.AbstractJavaBuilder.generatTemplates(AbstractJavaBuilder.java:113)
org.drools.rule.builder.dialect.java.JavaConsequenceBuilder.build(JavaConsequenceBuilder.java:95)
org.drools.rule.builder.RuleBuilder.build(RuleBuilder.java:67)
org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:446)
org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:304)
org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:167)
com.drools.util.RuleEngine.applyRule(RuleEngine.java:47)
com.drools.util.DroolsController.getAdvertisement(DroolsController.java:94)
com.drools.util.DroolsController.routeBusinessMethod(DroolsController.java:67)
com.drools.util.DroolsController.getAdvertisement(DroolsController.java:43)
com.drools.MyEndpoint.getAdvertisement(MyEndpoint.java:237)
com.drools.MyEndpoint.process(MyEndpoint.java:144)
org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:489)
org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:441)
org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(BaseLifeCycle.java:46)
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:595)
org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:174)
org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:176)
org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
java.lang.Thread.run(Thread.java:619)

drl file has 6 rules,
5 rules                   - which retract facts which passes the rule.
1 rule(low salience)  - will add the fact to java.util.List (set as global)
which passes the rule.

1 . Am i getting this error bcoz of the global list? or any other reason?
2 . How to solve this problem?

here the rules,

<code>
global java.util.List feasibleAdv;

rule " percentage rule "
   when
       $adv : Advertisement( percentageLimit != 0 , percentageLimit <
playedPercentage )
   then
       System.out.println("remove this adv (failed percentage):
"+$adv.getAdvertisementID());
       retract($adv);
end

rule "per day rule"
   when
       $adv : Advertisement( limitperday != 0 , limitperday <= playedperday
)
   then
       //System.out.println("remove this adv (failed day):
"+$adv.getAdvertisementID());
       retract($adv);
end

rule "per week rule"
   when
       $adv : Advertisement( limitperweek != 0 , limitperweek <=
playedperweek)
   then
       //System.out.println("remove this adv (failed week):
"+$adv.getAdvertisementID());
       retract($adv);
end

rule "per month rule"
   when
       $adv : Advertisement( limitpermonth != 0 , limitpermonth <=
playedpermonth)
   then
       //System.out.println("remove this adv (failed month) :
"+$adv.getAdvertisementID());
       retract($adv);
end

rule "total played rule"
   when
       $adv : Advertisement( totallimit != 0 , totallimit <= totalplayed )
   then
       //System.out.println("remove this adv (failed total played) :
"+$adv.getAdvertisementID());
       retract($adv);
end


rule "advertisement select rule"
salience -1
       when
               $adv : Advertisement( $playedPercentPerAdvertisement :
playedPercentPerAdvertisement)
               not( Advertisement( playedPercentPerAdvertisement <
$playedPercentPerAdvertisement ) )
               $advertisementCount : Integer()
       then
               boolean status = true;
               if($advertisementCount-1 < 0){
                       //System.out.println("halted");
                       status = false;
                       drools.halt();
               }
               if(status){
                       feasibleAdv.add($adv);
                       drools.update(
drools.getWorkingMemory().getFactHandle($advertisementCount), new
Integer($advertisementCount-1) );
                       retract($adv);
               }
end

</code>
--
View this message in context: http://www.nabble.com/Can-drools-work-in-multithreaded-environment--tp17053936p17053936.html
Sent from the drools - user mailing list archive at Nabble.com.

_______________________________________________
rules-users mailing list
rules-users@...
https://lists.jboss.org/mailman/listinfo/rules-users



--
Edson Tirelli
JBoss Drools Core Development
Office: +55 11 3529-6000
Mobile: +55 11 9287-5646
JBoss, a division of Red Hat @ www.jboss.com
_______________________________________________
rules-users mailing list
rules-users@...
https://lists.jboss.org/mailman/listinfo/rules-users

Re: Can drools work in multithreaded environment?

by Barath :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Edson,
I am using  4.0.3 version.

In my code,
 * For each thread new rule base and StatefulSession is created.
 * Then why i am getting the previously mentioned exceptions(which i posted in the first message) for few    threads only while other works fine.
 * Your suggestions please,
    " 1 . Am i getting this error bcoz of the global list? or any other reason?
      2 . How to solve this problem?"

~Barath.

Edson Tirelli-3 wrote:
   Barath,

   What version of drools are you using?

   The drools rulebase is designed to be shared among multiple threads. The
working memory (session) is not.
   Having said that, we had a couple bugs in the past regarding multi-thread
environments, and so you must use 4.0.7 version that is about to be
released. For you test, while you wait for the official release, you can
checkout the code and built it from here:

http://anonsvn.labs.jboss.com/labs/jbossrules/branches/4.0.x/

   []s
   Edson

2008/5/5 Barath <barathguna@gmail.com>:

>
> Hi,
>
> While doing a load test with jmeter,my web service application with drools
> works fine for few clients(5 simultaneous hits for 10 times)
> but when i increase my clients(120 simultanious hits for 100 times) i am
> gettin the following exception for
> few client, (out of 12,000 hits 200 throws this exception)
>
> problem encountered at node [11] 5{170,189}: unable to resolve property:
> null pointer exception in property: declr.identifier
> org.mvel.TemplateInterpreter.execute(TemplateInterpreter.java:528)
> org.mvel.TemplateInterpreter.parse(TemplateInterpreter.java:341)
>
> org.drools.rule.builder.dialect.java.AbstractJavaBuilder.generatTemplates(AbstractJavaBuilder.java:113)
>
> org.drools.rule.builder.dialect.java.JavaConsequenceBuilder.build(JavaConsequenceBuilder.java:95)
> org.drools.rule.builder.RuleBuilder.build(RuleBuilder.java:67)
> org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:446)
> org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:304)
>
> org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:167)
> com.drools.util.RuleEngine.applyRule(RuleEngine.java:47)
>
> com.drools.util.DroolsController.getAdvertisement(DroolsController.java:94)
>
> com.drools.util.DroolsController.routeBusinessMethod(DroolsController.java:67)
>
> com.drools.util.DroolsController.getAdvertisement(DroolsController.java:43)
> com.drools.MyEndpoint.getAdvertisement(MyEndpoint.java:237)
> com.drools.MyEndpoint.process(MyEndpoint.java:144)
>
> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:489)
>
> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:441)
>
> org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(BaseLifeCycle.java:46)
>
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:595)
>
> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:174)
>
> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:176)
>
> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>
> edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
>
> edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
> java.lang.Thread.run(Thread.java:619)
>
> drl file has 6 rules,
> 5 rules                   - which retract facts which passes the rule.
> 1 rule(low salience)  - will add the fact to java.util.List (set as
> global)
> which passes the rule.
>
> 1 . Am i getting this error bcoz of the global list? or any other reason?
> 2 . How to solve this problem?
>
> here the rules,
>
> <code>
> global java.util.List feasibleAdv;
>
> rule " percentage rule "
>    when
>        $adv : Advertisement( percentageLimit != 0 , percentageLimit <
> playedPercentage )
>    then
>        System.out.println("remove this adv (failed percentage):
> "+$adv.getAdvertisementID());
>        retract($adv);
> end
>
> rule "per day rule"
>    when
>        $adv : Advertisement( limitperday != 0 , limitperday <=
> playedperday
> )
>    then
>        //System.out.println("remove this adv (failed day):
> "+$adv.getAdvertisementID());
>        retract($adv);
> end
>
> rule "per week rule"
>    when
>        $adv : Advertisement( limitperweek != 0 , limitperweek <=
> playedperweek)
>    then
>        //System.out.println("remove this adv (failed week):
> "+$adv.getAdvertisementID());
>        retract($adv);
> end
>
> rule "per month rule"
>    when
>        $adv : Advertisement( limitpermonth != 0 , limitpermonth <=
> playedpermonth)
>    then
>        //System.out.println("remove this adv (failed month) :
> "+$adv.getAdvertisementID());
>        retract($adv);
> end
>
> rule "total played rule"
>    when
>        $adv : Advertisement( totallimit != 0 , totallimit <= totalplayed )
>    then
>        //System.out.println("remove this adv (failed total played) :
> "+$adv.getAdvertisementID());
>        retract($adv);
> end
>
>
> rule "advertisement select rule"
> salience -1
>        when
>                $adv : Advertisement( $playedPercentPerAdvertisement :
> playedPercentPerAdvertisement)
>                not( Advertisement( playedPercentPerAdvertisement <
> $playedPercentPerAdvertisement ) )
>                $advertisementCount : Integer()
>        then
>                boolean status = true;
>                if($advertisementCount-1 < 0){
>                        //System.out.println("halted");
>                        status = false;
>                        drools.halt();
>                }
>                if(status){
>                        feasibleAdv.add($adv);
>                        drools.update(
> drools.getWorkingMemory().getFactHandle($advertisementCount), new
> Integer($advertisementCount-1) );
>                        retract($adv);
>                }
> end
>
> </code>
> --
> View this message in context:
> http://www.nabble.com/Can-drools-work-in-multithreaded-environment--tp17053936p17053936.html
> Sent from the drools - user mailing list archive at Nabble.com.
>
> _______________________________________________
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



--
Edson Tirelli
JBoss Drools Core Development
Office: +55 11 3529-6000
Mobile: +55 11 9287-5646
JBoss, a division of Red Hat @ www.jboss.com

_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Re: Can drools work in multithreaded environment?

by Edson Tirelli-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


   You must update to 4.0.7. You are probably facing the issues we had in 4.0.3.

   []s
   Edson

2008/5/7 Barath <barathguna@...>:

Edson,
I am using  4.0.3 version.

In my code,
 * For each thread new rule base and StatefulSession is created.
 * Then why i am getting the previously mentioned exceptions(which i posted
in the first message) for few    threads only while other works fine.
 * Your suggestions please,
   " 1 . Am i getting this error bcoz of the global list? or any other
reason?
     2 . How to solve this problem?"

~Barath.


Edson Tirelli-3 wrote:
>
>    Barath,
>
>    What version of drools are you using?
>
>    The drools rulebase is designed to be shared among multiple threads.
> The
> working memory (session) is not.
>    Having said that, we had a couple bugs in the past regarding
> multi-thread
> environments, and so you must use 4.0.7 version that is about to be
> released. For you test, while you wait for the official release, you can
> checkout the code and built it from here:
>
> http://anonsvn.labs.jboss.com/labs/jbossrules/branches/4.0.x/
>
>    []s
>    Edson
>
> 2008/5/5 Barath <barathguna@...>:
>
>>
>> Hi,
>>
>> While doing a load test with jmeter,my web service application with
>> drools
>> works fine for few clients(5 simultaneous hits for 10 times)
>> but when i increase my clients(120 simultanious hits for 100 times) i am
>> gettin the following exception for
>> few client, (out of 12,000 hits 200 throws this exception)
>>
>> problem encountered at node [11] 5{170,189}: unable to resolve property:
>> null pointer exception in property: declr.identifier
>> org.mvel.TemplateInterpreter.execute(TemplateInterpreter.java:528)
>> org.mvel.TemplateInterpreter.parse(TemplateInterpreter.java:341)
>>
>> org.drools.rule.builder.dialect.java.AbstractJavaBuilder.generatTemplates(AbstractJavaBuilder.java:113)
>>
>> org.drools.rule.builder.dialect.java.JavaConsequenceBuilder.build(JavaConsequenceBuilder.java:95)
>> org.drools.rule.builder.RuleBuilder.build(RuleBuilder.java:67)
>> org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:446)
>> org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:304)
>>
>> org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:167)
>> com.drools.util.RuleEngine.applyRule(RuleEngine.java:47)
>>
>> com.drools.util.DroolsController.getAdvertisement(DroolsController.java:94)
>>
>> com.drools.util.DroolsController.routeBusinessMethod(DroolsController.java:67)
>>
>> com.drools.util.DroolsController.getAdvertisement(DroolsController.java:43)
>> com.drools.MyEndpoint.getAdvertisement(MyEndpoint.java:237)
>> com.drools.MyEndpoint.process(MyEndpoint.java:144)
>>
>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:489)
>>
>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:441)
>>
>> org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(BaseLifeCycle.java:46)
>>
>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:595)
>>
>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:174)
>>
>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:176)
>>
>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>>
>> edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
>>
>> edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
>> java.lang.Thread.run(Thread.java:619)
>>
>> drl file has 6 rules,
>> 5 rules                   - which retract facts which passes the rule.
>> 1 rule(low salience)  - will add the fact to java.util.List (set as
>> global)
>> which passes the rule.
>>
>> 1 . Am i getting this error bcoz of the global list? or any other reason?
>> 2 . How to solve this problem?
>>
>> here the rules,
>>
>> <code>
>> global java.util.List feasibleAdv;
>>
>> rule " percentage rule "
>>    when
>>        $adv : Advertisement( percentageLimit != 0 , percentageLimit <
>> playedPercentage )
>>    then
>>        System.out.println("remove this adv (failed percentage):
>> "+$adv.getAdvertisementID());
>>        retract($adv);
>> end
>>
>> rule "per day rule"
>>    when
>>        $adv : Advertisement( limitperday != 0 , limitperday <=
>> playedperday
>> )
>>    then
>>        //System.out.println("remove this adv (failed day):
>> "+$adv.getAdvertisementID());
>>        retract($adv);
>> end
>>
>> rule "per week rule"
>>    when
>>        $adv : Advertisement( limitperweek != 0 , limitperweek <=
>> playedperweek)
>>    then
>>        //System.out.println("remove this adv (failed week):
>> "+$adv.getAdvertisementID());
>>        retract($adv);
>> end
>>
>> rule "per month rule"
>>    when
>>        $adv : Advertisement( limitpermonth != 0 , limitpermonth <=
>> playedpermonth)
>>    then
>>        //System.out.println("remove this adv (failed month) :
>> "+$adv.getAdvertisementID());
>>        retract($adv);
>> end
>>
>> rule "total played rule"
>>    when
>>        $adv : Advertisement( totallimit != 0 , totallimit <= totalplayed
>> )
>>    then
>>        //System.out.println("remove this adv (failed total played) :
>> "+$adv.getAdvertisementID());
>>        retract($adv);
>> end
>>
>>
>> rule "advertisement select rule"
>> salience -1
>>        when
>>                $adv : Advertisement( $playedPercentPerAdvertisement :
>> playedPercentPerAdvertisement)
>>                not( Advertisement( playedPercentPerAdvertisement <
>> $playedPercentPerAdvertisement ) )
>>                $advertisementCount : Integer()
>>        then
>>                boolean status = true;
>>                if($advertisementCount-1 < 0){
>>                        //System.out.println("halted");
>>                        status = false;
>>                        drools.halt();
>>                }
>>                if(status){
>>                        feasibleAdv.add($adv);
>>                        drools.update(
>> drools.getWorkingMemory().getFactHandle($advertisementCount), new
>> Integer($advertisementCount-1) );
>>                        retract($adv);
>>                }
>> end
>>
>> </code>
>> --
>> View this message in context:
>> http://www.nabble.com/Can-drools-work-in-multithreaded-environment--tp17053936p17053936.html
>> Sent from the drools - user mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> rules-users mailing list
>> rules-users@...
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>
>
>
> --
> Edson Tirelli
> JBoss Drools Core Development
> Office: +55 11 3529-6000
> Mobile: +55 11 9287-5646
> JBoss, a division of Red Hat @ www.jboss.com
>
> _______________________________________________
> rules-users mailing list
> rules-users@...
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>

--
View this message in context: http://www.nabble.com/Can-i-use-drools-in-multithreaded-environment--tp17053936p17097302.html
Sent from the drools - user mailing list archive at Nabble.com.

_______________________________________________
rules-users mailing list
rules-users@...
https://lists.jboss.org/mailman/listinfo/rules-users



--
Edson Tirelli
JBoss Drools Core Development
Office: +55 11 3529-6000
Mobile: +55 11 9287-5646
JBoss, a division of Red Hat @ www.jboss.com
_______________________________________________
rules-users mailing list
rules-users@...
https://lists.jboss.org/mailman/listinfo/rules-users

Re: Can drools work in multithreaded environment?

by toddp2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I ran into the same issue running JMeter recently.  I am getting the same stack trace.  I checked my version and I am using 4.0.7 of Drools.  Was this resolved by going to 4.0.7 for you?  Is there anything else to check?

Todd


   



   You must update to 4.0.7. You are probably facing the issues we had in
4.0.3.

   []s
   Edson

2008/5/7 Barath <barathguna@gmail.com>:

>
> Edson,
> I am using  4.0.3 version.
>
> In my code,
>  * For each thread new rule base and StatefulSession is created.
>  * Then why i am getting the previously mentioned exceptions(which i
> posted
> in the first message) for few    threads only while other works fine.
>  * Your suggestions please,
>     " 1 . Am i getting this error bcoz of the global list? or any other
> reason?
>      2 . How to solve this problem?"
>
> ~Barath.
>
>
> Edson Tirelli-3 wrote:
> >
> >    Barath,
> >
> >    What version of drools are you using?
> >
> >    The drools rulebase is designed to be shared among multiple threads.
> > The
> > working memory (session) is not.
> >    Having said that, we had a couple bugs in the past regarding
> > multi-thread
> > environments, and so you must use 4.0.7 version that is about to be
> > released. For you test, while you wait for the official release, you can
> > checkout the code and built it from here:
> >
> > http://anonsvn.labs.jboss.com/labs/jbossrules/branches/4.0.x/
> >
> >    []s
> >    Edson
> >
> > 2008/5/5 Barath <barathguna@gmail.com>:

Re: Can drools work in multithreaded environment?

by Edson Tirelli-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


   If you are running 4.0.7 and using the proper MVEL dependecy lib, you should not be facing any concurrency problem, assuming you are sharing the rulebase but not the session.

   []s
   Edson

2008/9/4 toddp2 <tpatch@...>


I ran into the same issue running JMeter recently.  I am getting the same
stack trace.  I checked my version and I am using 4.0.7 of Drools.  Was this
resolved by going to 4.0.7 for you?  Is there anything else to check?

Todd






  You must update to 4.0.7. You are probably facing the issues we had in
4.0.3.

  []s
  Edson

2008/5/7 Barath <barathguna@...>:

>
> Edson,
> I am using  4.0.3 version.
>
> In my code,
>  * For each thread new rule base and StatefulSession is created.
>  * Then why i am getting the previously mentioned exceptions(which i
> posted
> in the first message) for few    threads only while other works fine.
>  * Your suggestions please,
>     " 1 . Am i getting this error bcoz of the global list? or any other
> reason?
>      2 . How to solve this problem?"
>
> ~Barath.
>
>
> Edson Tirelli-3 wrote:
> >
> >    Barath,
> >
> >    What version of drools are you using?
> >
> >    The drools rulebase is designed to be shared among multiple threads.
> > The
> > working memory (session) is not.
> >    Having said that, we had a couple bugs in the past regarding
> > multi-thread
> > environments, and so you must use 4.0.7 version that is about to be
> > released. For you test, while you wait for the official release, you can
> > checkout the code and built it from here:
> >
> > http://anonsvn.labs.jboss.com/labs/jbossrules/branches/4.0.x/
> >
> >    []s
> >    Edson
> >
> > 2008/5/5 Barath <barathguna@...>:

--
View this message in context: http://www.nabble.com/Can-i-use-drools-in-multithreaded-environment--tp17053936p19310976.html
Sent from the drools - user mailing list archive at Nabble.com.

_______________________________________________
rules-users mailing list
rules-users@...
https://lists.jboss.org/mailman/listinfo/rules-users



--
Edson Tirelli
JBoss Drools Core Development
JBoss, a division of Red Hat @ www.jboss.com

_______________________________________________
rules-users mailing list
rules-users@...
https://lists.jboss.org/mailman/listinfo/rules-users

Re: Can drools work in multithreaded environment?

by Mark Proctor :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

We are going to need some test to replicate this, if we are to fix it, unless someone else can track down the issue.

Mark
toddp2 wrote:
I ran into the same issue running JMeter recently.  I am getting the same
stack trace.  I checked my version and I am using 4.0.7 of Drools.  Was this
resolved by going to 4.0.7 for you?  Is there anything else to check? 

Todd


   



   You must update to 4.0.7. You are probably facing the issues we had in
4.0.3.

   []s
   Edson

2008/5/7 Barath barathguna@...:

  
Edson,
I am using  4.0.3 version.

In my code,
 * For each thread new rule base and StatefulSession is created.
 * Then why i am getting the previously mentioned exceptions(which i
posted
in the first message) for few    threads only while other works fine.
 * Your suggestions please,
    " 1 . Am i getting this error bcoz of the global list? or any other
reason?
     2 . How to solve this problem?"

~Barath.


Edson Tirelli-3 wrote:
    
   Barath,

   What version of drools are you using?

   The drools rulebase is designed to be shared among multiple threads.
The
working memory (session) is not.
   Having said that, we had a couple bugs in the past regarding
multi-thread
environments, and so you must use 4.0.7 version that is about to be
released. For you test, while you wait for the official release, you can
checkout the code and built it from here:

http://anonsvn.labs.jboss.com/labs/jbossrules/branches/4.0.x/

   []s
   Edson

2008/5/5 Barath barathguna@...:
      

  


_______________________________________________
rules-users mailing list
rules-users@...
https://lists.jboss.org/mailman/listinfo/rules-users