Drools Sample Project Won't Execute on Spring STS IDE 2.3.2
by Jason Mihalick
Versions involved:
IDE: Spring STS 2.3.2.RELEASE
Eclipse Drools Plugin: 5.1.1 (Includes JBoss Drools Core, JBoss Drools
Guvnor, JBoss Drools Task)
Java: JDK 1.6.0_11
Platform: Windows XP
1) Create a sample Drools application using the New Project Wizard and
selecting "Drools Project"
2) Name it MyDroolsProject
3) Check all options on the add sample classes (e.g., 'Add a sample
HelloWorld rule file to this project', etc.)
4) Check to 'Use default Drools Runtime (currently Drools 5.1.0 runtime)'.
Also choose to Generate code compatible with 'Drools 5.1.x'. Click Finish.
5) In your newly created 'MyDroolsProject', drill down to
com.sample.DecisionTableTest.java, right click and choose to 'Run As | Java
Application'
The following stack trace ensues. (Note, yes, I do have the STS Groovy
plugin installed)
Warning: Cell at E21 not present - adding a blank
Build groovy files option has not been set one way or the other: use
'options.put(CompilerOptions.OPTIONG_BuildGroovyFiles,
CompilerOptions.ENABLED);'
java.lang.NoClassDefFoundError: org/eclipse/core/runtime/Plugin
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at
org.eclipse.jdt.internal.compiler.Compiler.initializeParser(Compiler.java:755)
at
org.eclipse.jdt.internal.compiler.Compiler.<init>(Compiler.java:312)
at
org.eclipse.jdt.internal.compiler.Compiler.<init>(Compiler.java:177)
at
org.drools.commons.jci.compilers.EclipseJavaCompiler.compile(EclipseJavaCompiler.java:349)
at
org.drools.commons.jci.compilers.AbstractJavaCompiler.compile(AbstractJavaCompiler.java:51)
at
org.drools.rule.builder.dialect.java.JavaDialect.compileAll(JavaDialect.java:389)
at
org.drools.compiler.DialectCompiletimeRegistry.compileAll(DialectCompiletimeRegistry.java:56)
at
org.drools.compiler.PackageRegistry.compileAll(PackageRegistry.java:74)
at
org.drools.compiler.PackageBuilder.compileAll(PackageBuilder.java:677)
at
org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:640)
at
org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:254)
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:484)
at
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:34)
at
com.sample.DecisionTableTest.readKnowledgeBase(DecisionTableTest.java:44)
at com.sample.DecisionTableTest.main(DecisionTableTest.java:25)
Caused by: java.lang.ClassNotFoundException: org.eclipse.core.runtime.Plugin
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
... 27 more
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Sample-Project...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 9 months
Adding a programmatically created RuleFlowProcess to a KnowledgeBuilder
by Jason van Zyl
Hi,
I have been following the documentation to create a RuleFlowProcess, and I went the route of creating the flow programmatically, but I can't find an example of adding this process to the knowledge builder. It seems to want an external resource of a given type. In my little code scenario below how would I add this programmatically created RuleFlowProcess?
DefaultFlowGenerator flowGenerator = new DefaultFlowGenerator();
RuleFlowProcess flow = flowGenerator.generateFlow( "flow" );
KnowledgeBuilder knowledgeBuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
knowledgeBuilder.add( flow.getResource() /* this is null */, null /* what do i put here*/ );
Do I have to serialize to an external form and deserialize?
Thanks,
Jason
----------------------------------------------------------
Jason van Zyl
Founder, Apache Maven
http://twitter.com/jvanzyl
---------------------------------------------------------
Three people can keep a secret provided two of them are dead.
-- Unknown
Thanks,
Jason
----------------------------------------------------------
Jason van Zyl
Founder, Apache Maven
http://twitter.com/jvanzyl
---------------------------------------------------------
We know what we are, but know not what we may be.
-- Shakespeare
15 years, 9 months
xdrl, matches and nested method calls
by Veit Guna
Hi.
We're using Drools 5.1.0 with .xdrl files. Now we encountered a strange
problem with the 'matches' behavior.
We have the following pattern that seems to have the problem:
<dro:pattern object-type="EMail">
<dro:field-constraint field-name="subject">
<dro:literal-restriction evaluator="matches" value=".*\QCRYPT\E.*"/>
</dro:field-constraint>
</dro:pattern>
Subject is a String with the content "my CRYPT subject".
The rule isn't fired as expected. If we ONLY change
field-name="subject"
to
field-name="subject.trim"
the rule fires.
Any pointers what that is?
Thanks
Veit
15 years, 9 months
DSL to multiline DRL?
by Tim 4076
Is it possible to have a single line of DSL convert into multiple lines of DRL?
I want to hide the implementation of my rules from the user. So, using
my previous post as an example:
rule "group 1"
when
$a : Trans( $groupValue : prodCat, $date : date )
not Trans( this != $a, prodCat == $groupValue, date < $date )
$b : LinkedList( size >= 1 ) from collect ( Trans( this != $a,
prodCat == $groupValue, date > $date ) )
then
//do something
end
should become something like:
rule "group 1"
when
There are mutliple transactions with the same value for prodCat
then
//do something
end
Thanks,
Tim
15 years, 9 months
access guvnor information from extern
by Dominik Hüttner
Hi everyone, I work with the guvnor and want to use documentation
information externally. For example the description of a rule or the
description of a package, what is also posted in the documentation.pdf, that
is accessible through the url (f.e.:
http://192.168.1.192:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/Tes
t/LATEST/documention.pdf), on the buttom of the package overview page is the
link. But I want to work with the data, so the pdf is not usable, is there a
way to access these information in the guvnor directly from outside for
example from a reporting-tool?
Kind regards,
Dominik
15 years, 9 months
How to synchronize the Guvnor repository and the displaying of Guvnor UI?
by tim
Hi,
I have set up two instances of Guvnor in two separate Linux lab (lab1 and
lab2).
Each instance uses a separate MySQL database as its repository.
Two MySQL instances are deployed on lab1 and lab2 respectively, and are
configured as a replication mate, master-master mode.
When I create a new category from lab1's Guvnor UI, the change of the
repository can be synchronized to lab2's MySQL database. But the new
category can't be displayed in the lab2's Guvnor UI unless I restart the
tomcat on lab2.
Can you tell me how can I see the changes synchronously from the lab2's
Guvnor UI? Any suggestion will be appreciated.
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/How-to-synchronize-th...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 9 months
Nested classes in the fact model in Guvnor
by Chris Selwyn
If I have nested classes in my Java model, I find that the Guvnor is
giving me the option to import classes using a "$" as the separator
between the containing class name and the nested classname.
However, validation of rules always fails saying that the class name
with the "$" in it cannot be resolved.
If I change these into "." then the problem goes away.
Is this a known problem or am I missing something?
I am using Drools 5.1.1
Chris Selwyn
15 years, 9 months
Simple DSL example
by morge
Hi everybody,
I try to run a simple DSL example.
My DRL is as follows:
package org.mydrools.examples
#must be in the following order.
import org.mydrools.examples.Person
import org.mydrools.examples.Cheese
#refer to test_expander.dsl
expander test_expander.dsl
rule "my rule"
when
#Person(name=="Dani", likes=="maroilles")
#Cheese(type=="maroilles")
There is a person with the name of Dani who likes maroilles
There is some maroilles cheese available
then
Add the message "We have a winner"
#System.out.println("We have a winner");
end
My DSL is as follow:
#some description
[when]There is a person with the name of {name} who likes
{cheese}=Person(name=="{name}", likes=="{cheese}")
[when]There is some {cheese} cheese available=Cheese(type=="{cheese}")
[then]Add the message {message}=System.out.println({message});
[when]person with eval=p : Person() eval(p.getName().equals("fire"))
And I load them as below:
kbuilder.add(ResourceFactory.newClassPathResource("test_expander.dsl"),ResourceType.DSL);
kbuilder.add(ResourceFactory.newClassPathResource("Sample.drl"),
ResourceType.DRL);
The following error messages appear:
[8,9]: [ERR 101] Line 8:9 no viable alternative at input 'test_expander' in
rule expander
[11,0]: [ERR 101] Line 11:0 no viable alternative at input 'rule' in rule
expander in rule dsl
[15,2]: [ERR 101] Line 15:2 no viable alternative at input 'There' in rule
expander in rule dsl in rule "my rule"
Any idea ?
Thanks in advance,
Maxime.
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Simple-DSL-example-tp...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 9 months
Deadlock with multiple Entry Points
by Norman C
Drools can deadlock when facts are inserted/retracted/modified in multiple entry
points in the same session. Since each such action will acquire the lock
associated with the entry point, it's possible for the order of calls to cause
deadlock when the locks for two entry points are acquired by two different
threads, then the change in working memory activates and executes rules which
also insert/retract/modify and thus require acquiring the lock for the other
entry point.
As far as I can tell, there is no way to prevent this kind of deadlock other
than using only one entry point. Can anyone think of others?
In my case, I'm using Drools Fusion with two different entry points for events.
Whenever events expire, the engine automatically retracts them, so there are
lots of opportunities for the locks from each entry point to be acquired after
already holding the other entry point's lock. I used two different entry points
to separate different types of events for code clarity, so it's a simple
workaround in my application to consolidate all my events to use a single entry
point.
I can't think of a compelling reason for employing different entry points, so
maybe this isn't a big issue. But it would be good to know if there is another
way of preventing deadlock with multiple entry points.
Thanks,
Norman
15 years, 9 months
How do I persist at every node transition?
by kirakane
I setup JPA persistence using a MySQL DB and the BTM transaction manager as a
stand alone J2SE application. I'm trying to setup to be able to continue
from the last transition on a workflow if a process dies in the middle.
I have show sql turned on and I can see the ProcessInstance get saved at the
start but not at any of the node transitions. So if I kill the process in
the middle or simulate an outage and recover the session using
ksession = JPAKnowledgeService.loadStatefulKnowledgeSession(
sessionID, kbase, null, env );
the process restarts from the very beginning which is not the behavior I
desire.
For example for the RulesFlow
Start->A->B->C->End
and the server dies in B I would like the process to pickup from B.
How do I get this behavior?
Log:
--------------------------
create jpa backed stateful ksession
Hibernate: insert into SessionInfo (lastModificationDate, rulesByteArray,
startDate, OPTLOCK) values (?, ?, ?, ?)
Oct 18, 2010 10:56:14 AM bitronix.tm.twopc.Preparer prepare
WARNING: executing transaction with 0 enlisted resource
SESSIONID:80
Object Persisted
Hibernate: update SessionInfo set lastModificationDate=?, rulesByteArray=?,
startDate=?, OPTLOCK=? where id=? and OPTLOCK=?
Starting Process...
Hibernate: insert into ProcessInstanceInfo (externalVariables,
lastModificationDate, lastReadDate, processId, processInstanceByteArray,
startDate, state, OPTLOCK) values (?, ?, ?, ?, ?, ?, ?, ?)
Hibernate: update ProcessInstanceInfo set externalVariables=?,
lastModificationDate=?, lastReadDate=?, processId=?,
processInstanceByteArray=?, startDate=?, state=?, OPTLOCK=? where
InstanceId=? and OPTLOCK=?
Hibernate: insert into EventTypes (InstanceId, element) values (?, ?)
Hibernate: update SessionInfo set lastModificationDate=?, rulesByteArray=?,
startDate=?, OPTLOCK=? where id=? and OPTLOCK=?
Fire All Rules...
Created Status:VirusScanStatus [count=0, status=null, unquarantineCount=0]
Hibernate: select processins0_.InstanceId as col_0_0_ from
ProcessInstanceInfo processins0_ where ? in (select eventtypes1_.element
from EventTypes eventtypes1_ where
processins0_.InstanceId=eventtypes1_.InstanceId)
Hibernate: select processins0_.InstanceId as InstanceId1_0_,
processins0_.externalVariables as external2_1_0_,
processins0_.lastModificationDate as lastModi3_1_0_,
processins0_.lastReadDate as lastRead4_1_0_, processins0_.processId as
processId1_0_, processins0_.processInstanceByteArray as processI6_1_0_,
processins0_.startDate as startDate1_0_, processins0_.state as state1_0_,
processins0_.OPTLOCK as OPTLOCK1_0_ from ProcessInstanceInfo processins0_
where processins0_.InstanceId=?
In virus scanner:DocumentId [doc_id=THIS IS A DOCUMENT ID 1234]
did the scan:VirusScanStatus [count=1, status=success, unquarantineCount=0]
Hibernate: select processins0_.InstanceId as col_0_0_ from
ProcessInstanceInfo processins0_ where ? in (select eventtypes1_.element
from EventTypes eventtypes1_ where
processins0_.InstanceId=eventtypes1_.InstanceId)
remove from quarentine:DocumentId [doc_id=THIS IS A DOCUMENT ID 1234]
Hibernate: select processins0_.InstanceId as col_0_0_ from
ProcessInstanceInfo processins0_ where ? in (select eventtypes1_.element
from EventTypes eventtypes1_ where
processins0_.InstanceId=eventtypes1_.InstanceId)
VirusScanStatus [count=1, status=failed, unquarantineCount=1] sleeping:1000
Hibernate: select processins0_.InstanceId as col_0_0_ from
ProcessInstanceInfo processins0_ where ? in (select eventtypes1_.element
from EventTypes eventtypes1_ where
processins0_.InstanceId=eventtypes1_.InstanceId)
Hibernate: select processins0_.InstanceId as col_0_0_ from
ProcessInstanceInfo processins0_ where ? in (select eventtypes1_.element
from EventTypes eventtypes1_ where
processins0_.InstanceId=eventtypes1_.InstanceId)
entering state
remove from quarentine:DocumentId [doc_id=THIS IS A DOCUMENT ID 1234]
Hibernate: select processins0_.InstanceId as col_0_0_ from
ProcessInstanceInfo processins0_ where ? in (select eventtypes1_.element
from EventTypes eventtypes1_ where
processins0_.InstanceId=eventtypes1_.InstanceId)
VirusScanStatus [count=1, status=failed, unquarantineCount=2] sleeping:4000
Hibernate: select processins0_.InstanceId as col_0_0_ from
ProcessInstanceInfo processins0_ where ? in (select eventtypes1_.element
from EventTypes eventtypes1_ where
processins0_.InstanceId=eventtypes1_.InstanceId)
Hibernate: select processins0_.InstanceId as col_0_0_ from
ProcessInstanceInfo processins0_ where ? in (select eventtypes1_.element
from EventTypes eventtypes1_ where
processins0_.InstanceId=eventtypes1_.InstanceId)
entering state
remove from quarentine:DocumentId [doc_id=THIS IS A DOCUMENT ID 1234]
Hibernate: select processins0_.InstanceId as col_0_0_ from
ProcessInstanceInfo processins0_ where ? in (select eventtypes1_.element
from EventTypes eventtypes1_ where
processins0_.InstanceId=eventtypes1_.InstanceId)
VirusScanStatus [count=1, status=failed, unquarantineCount=3] sleeping:9000
Hibernate: select processins0_.InstanceId as col_0_0_ from
ProcessInstanceInfo processins0_ where ? in (select eventtypes1_.element
from EventTypes eventtypes1_ where
processins0_.InstanceId=eventtypes1_.InstanceId)
Hibernate: select processins0_.InstanceId as col_0_0_ from
ProcessInstanceInfo processins0_ where ? in (select eventtypes1_.element
from EventTypes eventtypes1_ where
processins0_.InstanceId=eventtypes1_.InstanceId)
entering state
remove from quarentine:DocumentId [doc_id=THIS IS A DOCUMENT ID 1234]
Hibernate: select processins0_.InstanceId as col_0_0_ from
ProcessInstanceInfo processins0_ where ? in (select eventtypes1_.element
from EventTypes eventtypes1_ where
processins0_.InstanceId=eventtypes1_.InstanceId)
Hibernate: select processins0_.InstanceId as col_0_0_ from
ProcessInstanceInfo processins0_ where ? in (select eventtypes1_.element
from EventTypes eventtypes1_ where
processins0_.InstanceId=eventtypes1_.InstanceId)
Hibernate: select variables0_.processInstanceId as processI5_1_,
variables0_.id as id1_, variables0_.name as formula1_1_, variables0_.id as
id4_0_, variables0_.name as name4_0_, variables0_.persister as
persister4_0_, variables0_.processInstanceId as processI5_4_0_,
variables0_.workItemId as workItemId4_0_, variables0_.entityClass as
entityCl7_4_0_, variables0_.entityId as entityId4_0_, variables0_.TYPE as
TYPE4_0_ from VariableInstanceInfo variables0_ where
variables0_.processInstanceId=?
Hibernate: select processins0_.InstanceId as col_0_0_ from
ProcessInstanceInfo processins0_ where ? in (select eventtypes1_.element
from EventTypes eventtypes1_ where
processins0_.InstanceId=eventtypes1_.InstanceId)
Hibernate: delete from EventTypes where InstanceId=?
Hibernate: delete from ProcessInstanceInfo where InstanceId=? and OPTLOCK=?
Hibernate: update SessionInfo set lastModificationDate=?, rulesByteArray=?,
startDate=?, OPTLOCK=? where id=? and OPTLOCK=?
finished
Here's my configuration:
orm.xml
--------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_1_0.xsd"
version="1.0">
<named-query name="ProcessInstancesWaitingForEvent">
<query>
select
processInstanceInfo.processInstanceId
from
ProcessInstanceInfo processInstanceInfo
where
:type in elements(processInstanceInfo.eventTypes)
</query>
</named-query>
</entity-mappings>
persistance.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">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>jdbc/TEST</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>
<class>org.drools.persistence.processinstance.variabletypes.VariableInstanceInfo</class>
<class>org.drools.persistence.processinstance.variabletypes.JPAPersistedVariable</class>
<properties>
<property name="hibernate.dialect"
value="org.hibernate.dialect.MySQL5Dialect" />
<property name="hibernate.max_fetch_depth" value="3"/>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.transaction.manager_lookup_class"
value="org.hibernate.transaction.BTMTransactionManagerLookup"/>
<property name="hibernate.jndi.class"
value="bitronix.tm.jndi.BitronixInitialContextFactory"/>
</properties>
</persistence-unit>
</persistence>
Calling Code
-------------------------------
public static final void main(String[] args) {
try {
createDataSource();
// load up the knowledge base
KnowledgeBase kbase = readKnowledgeBase();
// create the entity manager factory and register it in the
// environment
System.out.println("create entity manager");
System.setProperty(Context.INITIAL_CONTEXT_FACTORY,
"bitronix.tm.jndi.BitronixInitialContextFactory");
EntityManagerFactory emf = Persistence
.createEntityManagerFactory("org.drools.persistence.jpa");
Environment env = KnowledgeBaseFactory.newEnvironment();
env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf);
env.set(Context.INITIAL_CONTEXT_FACTORY,
"bitronix.tm.jndi.BitronixInitialContextFactory");
env.set(EnvironmentName.TRANSACTION_MANAGER,TransactionManagerServices.getTransactionManager());
// create a new knowledge session that uses JPA to store the
runtime
// state
System.out.println("create jpa backed stateful ksession");
StatefulKnowledgeSession ksession = null;
if (ksession == null) {
ksession = JPAKnowledgeService
.newStatefulKnowledgeSession(kbase, null, env);
int sessionId = ksession.getId();
System.out.println("SESSIONID:" + sessionId);
Persister pes = new Persister();
pes.put(new Integer(sessionId));
}
// KnowledgeRuntimeLogger logger =
KnowledgeRuntimeLoggerFactory.newConsoleLogger(ksession);
KnowledgeRuntimeLogger logger = KnowledgeRuntimeLoggerFactory
.newFileLogger(ksession, "test");
ksession.insert(new DocumentId("THIS IS A DOCUMENT ID 1234"));
System.out.println("Starting Process...");
ksession.startProcess("VirusScan");
System.out.println("Fire All Rules...");
ksession.fireAllRules();
System.out.println("finished");
logger.close();
// ksession.dispose();
} catch (Throwable t) {
t.printStackTrace();
}
}
private static KnowledgeBase readKnowledgeBase() throws Exception {
KnowledgeBuilder kbuilder =
KnowledgeBuilderFactory.newKnowledgeBuilder();
kbuilder.add(ResourceFactory.newClassPathResource("VirusScanner.drl",VirusScanStatus.class),
ResourceType.DRL);
kbuilder.add(ResourceFactory.newClassPathResource("VirusScan.rf",VirusScanStatus.class),
ResourceType.DRF);
KnowledgeBuilderErrors errors = kbuilder.getErrors();
if (errors.size() > 0) {
System.out.println("NUM:" + errors.size());
for (KnowledgeBuilderError error : errors) {
System.err.println("A_ERROR:" + error);
}
throw new IllegalArgumentException("Could not parse
knowledge.");
}
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());
return kbase;
}
private static void createDataSource() {
System.out.println("creating datasource");
Configuration conf = TransactionManagerServices.getConfiguration();
conf.setServerId("jvm-1");
conf.setLogPart1Filename("./tx-logs/part1.btm");
conf.setLogPart2Filename("./tx-logs/part2.btm");
PoolingDataSource ds = new PoolingDataSource();
ds.setUniqueName("jdbc/TEST");
ds.setClassName("com.mysql.jdbc.jdbc2.optional.MysqlXADataSource");
ds.setMaxPoolSize(3);
ds.setAllowLocalTransactions(true);
ds.getDriverProperties().put("user", "jboss");
ds.getDriverProperties().put("password", "jboss");
ds.getDriverProperties().put("URL",
"jdbc:mysql://localhost:3306/jpadrools5");
ds.init();
}
Regards,
Lawrence
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/How-do-I-persist-at-e...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 9 months