Re: [rules-users] Loading facts and memory size limits
by Greg Barton
Considering that just an Object array of 10 million Objects consumes 115MB of memory, I think loading 1 billion facts will be stretching the limits of the VM all by itself. (and that's java.lang.Object with no fields...)
GreG
On Sep 8, 2010, at 10:31, bellios <carfid(a)gmail.com> wrote:
Hi all,
i have read the Documentation and the Drools book. I am developping an
application but i don't understand in my case how i can loading a
1,000,000,000 facts (approx).
At present I load all facts into a StatefulKnowledgeSession with a for-
cycle and I insert them into ksession ("ksession.insert(customer);")
The problem is the out of memory exception due the high memory
requirements of facts.
How i can resolve it? There is another approach to
facts loading into session? Can i integrate the loading with JPA/Hibernate
frameworks?
Thanks in advance for any suggestion,
David
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Loading-facts-and-mem...
Sent from the Drools - User mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
15 years, 10 months
JMS Messenger
by Tina Vießmann
Hi,
I'm using JMS (especially Apache ActiveMQ) in my application. Right
now, I'm manually establishing the JMS connection, extracting my Java
objects from the JMS messages and inserting the objects into the
knowledge base. It's simple without any hype.
Until now, I've always missed the chapter about the JMS Messenger in the
Expert User Guide somehow. Now I've read about it, I'm asking myself if
it can be helpful to me. But based on the short description I can't make
really head or tail of it.
Could someone explain its functionality more detailed to me, please?
Thank you for any help! :)
Tina
15 years, 10 months
What's the use of the RemoveIdentitiesOption?
by Wolfgang Laun
I do understand both ways of the AssertBehaviorOption, but what's the
function of the RemoveIdentitiesOption? (This one's not in Drools Expert,
and Javadoc doesn't explain.)
-W
15 years, 10 months
Persistence.createEntityManagerFactory NullPointerException
by 亮亮
hi:
in my webapp, I use JPA to store the runtime state,i use this code in
VdcService.java which is a sample java class:
EntityManagerFactory emf =Persistence.createEntityManagerFactory(
"org.drools.persistence.jpa" );
Environment env = KnowledgeBaseFactory.newEnvironment();
env.set( EnvironmentName.ENTITY_MANAGER_FACTORY, emf );
// create a new knowledge session that uses JPA to store the runtime state
StatefulKnowledgeSession ksession =
JPAKnowledgeService.newStatefulKnowledgeSession( kbase, null, env );
I put persistence.xml to webRoot/META-INF/ , persistence.xml:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<persistence
version="1.0"
xsi:schemaLocation=
"http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd
http://java.sun.com/xml/ns/persistence/orm
http://java.sun.com/xml/ns/persistence/orm_1_0.xsd"
xmlns:orm="http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/persistence">
<persistence-unit name="org.drools.persistence.jpa"
transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:comp/env/jdbc/mysql</jta-data-source>
<class>org.drools.persistence.session.SessionInfo</class>
<class>org.drools.persistence.processinstance.ProcessInstanceInfo</class>
<class>org.drools.persistence.processinstance.ProcessInstanceEventInfo</class>
<class>org.drools.persistence.processinstance.WorkItemInfo</class>
<properties>
<property name="hibernate.dialect"
value="org.hibernate.dialect.MySQLDialect"/>
<property name="hibernate.max_fetch_depth" value="3"/>
<property name="hibernate.hbm2ddl.auto" value="create" />
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.transaction.manager_lookup_class"
value="org.hibernate.transaction.BTMTransactionManagerLookup" />
</properties>
</persistence-unit>
</persistence>
I use resin 3.1.10, $resin-home/conf/resin.conf:
<database>
<jndi-name>jdbc/mysql</jndi-name>
<driver type="org.gjt.mm.mysql.Driver">
<url>jdbc:mysql://127.0.0.1:3306/test</url>
<user>root</user>
<password></password>
</driver>
<prepared-statement-cache-size>8</prepared-statement-cache-size>
<max-connections>20</max-connections>
<max-idle-time>30s</max-idle-time>
</database>
when i run this webapp , i got this exception:
java.lang.NullPointerException
at
com.caucho.amber.manager.AmberPersistenceProvider.createEntityManagerFactory(AmberPersistenceProvider.java:65)
at
javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:69)
at com.abc.abc.service.VdcService.exec(VdcService.java:32)
at com.abc.abc.resources.Apply.apply(Apply.java:55)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:156)
at
com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:67)
at
com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:208)
at
com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:75)
at
com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:115)
at
com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:67)
at
com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:724)
at
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:689)
at
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:680)
at
com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:324)
at
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:425)
at
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:604)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:91)
at
com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:103)
at
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:416)
at
com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:87)
at
org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:99)
at
com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:87)
at
com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:187)
at
com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:265)
at
com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:273)
at com.caucho.server.port.TcpConnection.run(TcpConnection.java:682)
at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:743)
at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:662)
at java.lang.Thread.run(Thread.java:619)
i can't solve it.How to solve it?help me ,THS
15 years, 10 months
Drools FLow Persistence and Sessions
by Chrystall, Greg
Hi,
When using persistence what is the best approach to creating sessions?
I can resume a session if the service was shutdown based on the session ID, but how often should I be creating new sessions?
Can I have multiple sessions writing to the same database?
Any guidance appreciated.
Greg
________________________________
**************************************************************************************
This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmaster(a)nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary.
NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00
**************************************************************************************
15 years, 10 months
Nested access to process variables
by marton.bokor
Hi,
I have some process variabless passed via map in startProcess. AFAIU these
represent the current state of my process instance so what I would like to
do is compare these in a condition of a wait state node against an inserted
fact, which would be the dynamic (changing) part (Because I imagined that
this is what wait nodes are mostly good for, hope I'm right...). AFAIK this
node accepts only rule syntax (no mvel or java) so ATM I managed to do it
with eval, see code below, but it is ugly:
transaction : TransactionDAO( ) #this is the changing part
processInstance : WorkflowProcessInstance() #this is the process level
eval(
((APSSender)((BaseForm)processInstance.getVariable("form")).getDao()).getTransactionId().equals(transaction.getTransactionId())
)
As you can see the left side in eval is a nested object. In java it would
look like simply form.getDao().getTransactionId(). My question is how can I
do it with rule syntax without eval? Is it possible? I was experimenting
like a whole day with no success. Please help!
Thanks
Marton
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Nested-access-to-proc...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 10 months
error while running a dsl
by Kripa Nathwani
Hello,
I have written the following simple DSL in Drools:
[when]employee belongs to a particular state{state}=$employee:employee (statename=="{state}");
[then]Greet Employee=System.out.println("Hello");
I have also created the corresponding model with a field named "state".
When I try to create business rule for the same and when I validate the rule I get the following error:
Unable to create Field Extractor for 'statename' of '[ClassObjectType class=dslDemoPackage.employee]' in rule 'testdsl'
Let me know how I can resolve.
Best Regards,
Kripa
________________________________
This Email may contain confidential or privileged information for the intended recipient (s) If you are not the intended recipient, please do not use or disseminate the information, notify the sender and delete it from your system.
______________________________________________________________________
15 years, 10 months
Drools 5.1 framework codebase
by Swapnil Sawant
Hi,
I have my application built on some framework. I am using drools 5.1 in my
app as a rule engine
and would be using drools for implementing workflow too.
I am thinking of integrating my app's framework with framework for drools
Drools is an open-source package. Hence, I would want to get the drools 5.1
framework codebase which can be setup,studied,customized and run when
needed. Also, if there is any documentation related to framework , please
share that too.
Thanks,
Swapnil Sawant
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-5-1-framework-...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 10 months