Hi ,
when i run the below code with 2 or more thread i am getting deadlock error.
below attached "persistence.xml, jndi prop and datasource code". Kindly help
to solve the error
public static final void main(String[] args){
KnowledgeBuilder knowledgeBuilder =
KnowledgeBuilderFactory.newKnowledgeBuilder();
knowledgeBuilder.add(ResourceFactory.newClassPathResource("samplerulefile.rf"),
ResourceType.DRF);
KnowledgeBase kbase = knowledgeBuilder.newKnowledgeBase();
EntityManagerFactory emf =
Persistence.createEntityManagerFactory("org.drools.persistence.jpa");
Environment env = KnowledgeBaseFactory.newEnvironment();
env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf);
BitronixTransactionManager transactionManager =
TransactionManagerServices.getTransactionManager();
env.set(EnvironmentName.TRANSACTION_MANAGER, transactionManager);
StatefulKnowledgeSession ksession =
JPAKnowledgeService.newStatefulKnowledgeSession(kbase, null, env);
ksession.getWorkItemManager().registerWorkItemHandler("Human Task", new
NotificationWorkItemHandler());
JPAWorkingMemoryDbLogger auditlog = new JPAWorkingMemoryDbLogger(ksession);
ProcessInstance p = (ProcessInstance) ksession.startProcess("ruleid",null);
auditlog.dispose();
ksession.dispose();
}
*
persistence.xml:*
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";>
org.hibernate.ejb.HibernatePersistence
jdbc/processInstanceDS
org.jbpm.persistence.processinstance.ProcessInstanceInfo
org.jbpm.persistence.processinstance.ProcessInstanceInfo
org.drools.persistence.info.SessionInfo
org.drools.persistence.info.WorkItemInfo
org.drools.persistence.processinstance.variabletypes.VariableInstanceInfo
org.jbpm.process.audit.ProcessInstanceLog
org.jbpm.process.audit.NodeInstanceLog
*jndi property:*
java.naming.factory.initial=bitronix.tm.jndi.BitronixInitialContextFactory
*datasource:*
PoolingDataSource ds = new PoolingDataSource();
ds.setUniqueName("jdbc/processInstanceDS");
ds.setClassName("oracle.jdbc.xa.client.OracleXADataSource");
ds.setMaxPoolSize(3);
ds.setAllowLocalTransactions(true);
ds.getDriverProperties().put("user", "username");
ds.getDriverProperties().put("password", "password");
ds.getDriverProperties().put("URL","jdbc:oracle:thin:@192.168.1.115:1521:TEST");
ds.setAllowLocalTransactions(true);
ds.init();
Regards
Dhinesh
--
View this message in context:
http://drools.46999.n3.nabble.com/rules-users-Drools-Ruleflow-deadlock-issue-thread-tp3136746p3147770.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users