Best practice to use heap memory effectively
by mohan
Hi ,
I want to keep events valid for 24 hour period. Per day I’m getting over
1000K events & insert into session. I saw that heap usage increase
drastically because of this. What is the best practice to handle such a
situation? Do I need to choose some caching mechanism?
Meantime I’m using “Statefulknowledge” session and use single session to
cater each event & never call session.dispose(). Will there be any impact?
I’m using Drool 5.1.1, jboss-5.1.0.GA, jre 1.6.0_33
Thanks.
Mohan
--
View this message in context: http://drools.46999.n3.nabble.com/Best-practice-to-use-heap-memory-effect...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 5 months
Is Flow / jBPM dying on the vine?
by dunnlow
Hi,
I am considering using drools with Flow/jBPM as an integral part of a
corporate solution. However, it seems to me like the project is dying on
the vine. I understand the code is still being worked but overall interest
seems to be waning; evidenced by things like, a (...the) jBPM 5 book due two
months ago is still MIA. No blog posts on the project for six weeks.
I don't mean to bash jBPM, but am just worried about it's future. I suppose
the Flow/jBPM merge is irreversible? Any thoughts?
Is anyone using another BPM system with drools?
Thanks,
-J
--
View this message in context: http://drools.46999.n3.nabble.com/Is-Flow-jBPM-dying-on-the-vine-tp402073...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 5 months
Re: [rules-users] JITting error with 5.5.0.CR1
by paulk_asert
I should have added that the script still completes successfully, it is only
the JIT optimization that is having problems and only when some threshold is
reached causing an attempt at performing the optimization - as per
descriptions I have read earlier. The problem is that I thought there was a
fix already in place for this problem if I read the earlier posts correctly
but perhaps I do not know how to enable it.
paulk_asert wrote
> When I run this Groovy script using drools 5.5.0.CR1 with numAnimals = 8
> and numLegs = 120, it works fine. If I set numAnimals = 17 and numLegs =
> 1020 then it fails with a JITting error. I saw a bunch of Jira issues
> related to JITting issues but no open ones seemed to match exactly.
>
> @GrabResolver('https://repository.jboss.org/nexus/content/groups/public-jboss/')
> @Grab('org.drools:knowledge-api:5.5.0.CR1')
> @Grab('org.drools:drools-compiler:5.5.0.CR1')
> @Grab('org.drools:drools-core:5.5.0.CR1')
> @Grab('com.sun.xml.bind:jaxb-xjc:2.2.5.jboss-1')
> @GrabExclude('com.github.relaxng:relaxngDatatype')
> @GrabResolver('http://repo2.maven.org/maven2/')
> @Grab('org.mvel#mvel2;2.1.2.Final')
> @Grab('org.slf4j#slf4j-simple;1.6.4')
> import groovy.transform.Immutable
> import static org.drools.KnowledgeBaseFactory.newKnowledgeBase
> import static
> org.drools.builder.KnowledgeBuilderFactory.newKnowledgeBuilder
> import static org.drools.builder.ResourceType.DRL
> import static org.drools.io.ResourceFactory.newReaderResource
>
> def numAnimals = 8
> def numLegs = 120
> def kbuilder = newKnowledgeBuilder()
> def drl = '''
> dialect "mvel"
> rule "deduce animal counts"
> when
> $crane : Crane( )
> $centipede : Centipede( )
> $tortoise : Tortoise(
> quantity + $crane.quantity + $centipede.quantity == ''' + numAnimals
> + ''',
> quantity * numLegs + $crane.quantity * $crane.numLegs +
> $centipede.quantity * $centipede.numLegs == ''' + numLegs + '''
> )
> then
> System.out.println( "Cranes " + $crane.getQuantity() )
> System.out.println( "Tortoises " + $tortoise.getQuantity() )
> System.out.println( "Centipedes " + $centipede.getQuantity() )
> end
> '''
> kbuilder.add(newReaderResource(new StringReader(drl)), DRL)
> def kbase = newKnowledgeBase()
> kbase.addKnowledgePackages(kbuilder.knowledgePackages)
> def ksession = kbase.newStatefulKnowledgeSession()
>
> (numAnimals + 1).times { n ->
> if (numLegs.intdiv(Crane.numLegs) >= n) {
> ksession.insert(new Crane(n))
> }
> if (numLegs.intdiv(Tortoise.numLegs) >= n) {
> ksession.insert(new Tortoise(n))
> }
> if (numLegs.intdiv(Centipede.numLegs) >= n) {
> ksession.insert(new Centipede(n))
> }
> }
>
> ksession.fireAllRules()
> ksession.dispose()
>
> @Immutable
> class Crane {
> static int numLegs = 2
> int quantity
> }
>
> @Immutable
> class Tortoise {
> static int numLegs = 4
> int quantity
> }
>
> @Immutable
> class Centipede {
> static int numLegs = 100
> int quantity
> }
>
> Here is the error message:
>
> Exception in thread "Thread-1" java.lang.RuntimeException: Exception
> jitting: quantity + $crane.quantity + $centipede.quantity == 17 &&
> quantity * numLegs + $crane.quantity * $crane.numLegs +
> $centipede.quantity * $centipede.numLegs == 1020
> at
> org.drools.rule.constraint.MvelConstraint.executeJitting(MvelConstraint.java:275)
> at
> org.drools.rule.constraint.MvelConstraint.access$200(MvelConstraint.java:51)
> at
> org.drools.rule.constraint.MvelConstraint$ConditionJitter.run(MvelConstraint.java:250)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
> at java.lang.Thread.run(Thread.java:722)
> Caused by: java.lang.RuntimeException: java.lang.RuntimeException: Error
> writing method evaluate
> at
> org.drools.rule.builder.dialect.asm.ClassGenerator.newInstance(ClassGenerator.java:200)
> at
> org.drools.rule.constraint.ASMConditionEvaluatorJitter.jitEvaluator(ASMConditionEvaluatorJitter.java:53)
> at
> org.drools.rule.constraint.MvelConstraint.executeJitting(MvelConstraint.java:273)
> ... 5 more
> Caused by: java.lang.RuntimeException: Error writing method evaluate
> at
> org.drools.rule.builder.dialect.asm.ClassGenerator$MethodDescr.write(ClassGenerator.java:881)
> at
> org.drools.rule.builder.dialect.asm.ClassGenerator.generateBytecode(ClassGenerator.java:128)
> at
> org.drools.rule.builder.dialect.asm.ClassGenerator.generateClass(ClassGenerator.java:144)
> at
> org.drools.rule.builder.dialect.asm.ClassGenerator.newInstance(ClassGenerator.java:198)
> ... 7 more
> Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
> at org.mvel2.asm.Frame.merge(Frame.java:1373)
> at org.mvel2.asm.Frame.merge(Frame.java:1329)
> at org.mvel2.asm.MethodWriter.visitMaxs(MethodWriter.java:1282)
> at
> org.drools.rule.builder.dialect.asm.ClassGenerator$MethodDescr.write(ClassGenerator.java:879)
> ... 10 more
>
> Is this a known issue?
>
> Thanks, Paul.
--
View this message in context: http://drools.46999.n3.nabble.com/JITting-error-with-5-5-0-CR1-tp4020565p...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 5 months
Decision table errors
by Mahadevappa, Shobha
Hi,
I have a decision table which has an invalid column.
Drools gives the below compilation error but I am not sure about what is the line number (highlighted in red below) it is referring to in the error message.
Any pointers towards this is greatly appreciated.
Unable to Analyse Expression logType_41 == "2101":
Error: unable to resolve method using strict-mode: com.keane.nREAP.util.generatedclasses.SHOLOG.logType_41()]
Near : {... logType_41 == "2101" ....}]
^
[Line: 8, Column: 19] : [Rule name='VerificationAgain_12']
Regards,
Shobha M | Senior Program Manager, A&AD | NTT DATA Global Delivery Services Limited| w. +91-80-26659482 (Ext 3679) | v. 8814.3679 | m. +91.9972522743 | shobha.mahadevappa(a)nttdata.com<mailto:shobha.mahadevappa@nttdata.com>
______________________________________________________________________
Disclaimer:This email and any attachments are sent in strictest confidence for the sole use of the addressee and may contain legally privileged, confidential, and proprietary data. If you are not the intended recipient, please advise the sender by replying promptly to this email and then delete and destroy this email and any attachments without any further use, copying or forwarding
11 years, 5 months
Locking problems when using JBPM with persistence on PostgreSQL
by Alberto R. Galdo
Hi,
We have a system that executes processes inside a JBPM session which is
persisted using JPA and Hibernate as entity manager .
What we are suffering is locking inside JBPM in certain circumstances.
What we experience is that the JBPM process gets locked when in a
transaction to store it's internal state in the database ( sessioninfo,
processinstanceinfo, ... ). When locked PostgreSQL has a connection that is
in state "idle in transation", this means that a transaction was open (
BEGIN ) and nobody did neither commit nor rollback. Both JBPM and
PostgreSQL are waiting for something to happend that never comes. And there
are ExclusiveLocks and RowExclusiveLocks available in the database (
different tables each time, sometimes pg_largeobject, sometimes others ).
Our application that uses extensively JBPM is then locked and our users
are unable to execute any operation. We even tried to solve the lock by
killing the connection to the database, then the locks in the database
dissappear but JBPM never recovers ( maybe died with the connection ).
Has anyone seen something like this before?
Greets,
Alberto R. Galdo
argaldo(a)gmail.com
11 years, 5 months
Drools persistence errors in JBoss 7.x
by Alberto R. Galdo
Hi,
We have an application that uses JBPM and Drools to execute BPMN 2.0
processes. Our knowledge session gets persisted in a PostgreSQL database
and so it is StatefulKnowledgeSession.
Our application runs inside a JBoss 7.x server, our JPA context uses the
bundled Hibernate 4.x as entity manager and JBoss Tx service ( bundled with
jboss) as hibernate's transaction JTA implementation.
From time to time ( we haven't found a way to reproduce this, but clearly
has occurrences in the execution of our application ) we are getting this
kind of exceptions:
Caused by: org.hibernate.exception.GenericJDBCException: Connection is not
associated with a managed
connection.org.jboss.jca.adapters.jdbc.jdk6.WrappedConnectionJDK6@253770bd
during commits induced by Drools
[org.drools.persistence.jta.JtaTransactionManager.commit] ( as you can see
in the full stacktrace attached at the bottom of this mail )
The problem here is that our processes stop executing because of this
exception. For instance, there are times when this exception arises when
commiting a transaction that contains a human task persistance and because
of the exception this information is lost, breaking our processes ( now
nobody will never be ever able to restart the process by completing a human
task ).
Have any of you found this situation before? Any insight?
12:27:47,677 WARN [com.arjuna.ats.arjuna] (pool-11-thread-1) ARJUNA012125:
TwoPhaseCoordinator.beforeCompletion - failed for SynchronizationImple<
0:ffffc0a802fb:-1f97a856:5093fdd2:620,
org.hibernate.engine.transaction.synchronization.internal.RegisteredSynchronization@79da2820>:
javax.persistence.PersistenceException:
org.hibernate.exception.GenericJDBCException: Connection is not associated
with a managed
connection.org.jboss.jca.adapters.jdbc.jdk6.WrappedConnectionJDK6@253770bd
at
org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1361)
[hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]
at
org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1289)
[hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]
at
org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1295)
[hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]
at
org.hibernate.ejb.AbstractEntityManagerImpl$CallbackExceptionMapperImpl.mapManagedFlushFailure(AbstractEntityManagerImpl.java:1481)
[hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]
at
org.hibernate.engine.transaction.synchronization.internal.SynchronizationCallbackCoordinatorImpl.beforeCompletion(SynchronizationCallbackCoordinatorImpl.java:109)
[hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at
org.hibernate.engine.transaction.synchronization.internal.RegisteredSynchronization.beforeCompletion(RegisteredSynchronization.java:53)
[hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at
com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:76)
at
com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:273)
at
com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:93)
at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:164)
at
com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1165)
at
com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:117)
at
com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:75)
at
org.jboss.tm.usertx.client.ServerVMClientUserTransaction.commit(ServerVMClientUserTransaction.java:167)
at
org.drools.persistence.jta.JtaTransactionManager.commit(JtaTransactionManager.java:179)
[drools-persistence-jpa-6.0.0-SNAPSHOT.jar:6.0.0-SNAPSHOT]
at
org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:376)
[drools-persistence-jpa-6.0.0-SNAPSHOT.jar:6.0.0-SNAPSHOT]
at
org.drools.persistence.jpa.JpaTimerJobInstance.call(JpaTimerJobInstance.java:34)
[drools-persistence-jpa-6.0.0-SNAPSHOT.jar:6.0.0-SNAPSHOT]
at
org.drools.persistence.jpa.JpaTimerJobInstance.call(JpaTimerJobInstance.java:14)
[drools-persistence-jpa-6.0.0-SNAPSHOT.jar:6.0.0-SNAPSHOT]
at
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
[rt.jar:1.6.0_18]
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
[rt.jar:1.6.0_18]
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:165)
[rt.jar:1.6.0_18]
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:266)
[rt.jar:1.6.0_18]
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
[rt.jar:1.6.0_18]
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
[rt.jar:1.6.0_18]
at java.lang.Thread.run(Thread.java:636) [rt.jar:1.6.0_18]
Caused by: org.hibernate.exception.GenericJDBCException: Connection is not
associated with a managed
connection.org.jboss.jca.adapters.jdbc.jdk6.WrappedConnectionJDK6@253770bd
Alberto R. Galdo
argaldo(a)gmail.com
-
11 years, 5 months
Drools Guvnor API information?
by Vikas Hazrati
Hi,
I am looking at using Guvnor for our project where users would be creating
rules using our UI. For this i need to add / modify rule or any asset for
that matter using an api.
Unfortunately, i could not find enough documentation to suggest the best way
to use the REST api, which I guess is provided by Guvnor. Could someone let
me know the location of where i can get some information for this api. I
also see that the issue GUVNOR-1080
(https://issues.jboss.org/browse/GUVNOR-1080) is marked resolved so the api
should exist right? or that we cannot access it remotely until we have the
Atom Pub Interface done?
Help appreciated .
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Guvnor-API-inf...
Sent from the Drools - User mailing list archive at Nabble.com.
11 years, 5 months