Re: [rules-users] Drools Ruleflow deadlock issue[thread]

2011-07-07 Thread vdhinesh
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


Re: [rules-users] Drools Ruleflow deadlock issue[thread]

2011-07-06 Thread drdaveg
Your issue looks like a persistence issue, not a DROOLS issue.  If you do
more metering and experimentation people may be able to solve this for you. 
You may want to check posts from about a year ago; there were MANY people
asking about JPA workflow persistence.  

--
View this message in context: 
http://drools.46999.n3.nabble.com/rules-users-Drools-Ruleflow-deadlock-issue-thread-tp3136746p3145183.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


[rules-users] Drools Ruleflow deadlock issue[thread]

2011-07-04 Thread vdhinesh
Hi,

i am getting the below error while creating the ksession.startProcess()
instance in multithread.
i.e. two thread calling the ksession.startprocess() with the ruleflow  as

http://drools.46999.n3.nabble.com/file/n3136706/ruleflow.bmp 

based on initial testing i identified due to delete or update sql operation
the below is appearing. Please let me know how to solve this issue

ERROR LOG:
Hibernate: delete from ProcessInstanceInfo where InstanceId=? and OPTLOCK=?
Hibernate: delete from ProcessInstanceInfo where InstanceId=? and OPTLOCK=?
2011/07/04 11:20:06.475{UTC} [JDBCExceptionReporter :
JDBCExceptionReporter.java: logExceptions: 100] [RMI TCP
Connection(6)-10.50.53.32]:  WARN: :  SQL Error: 60, SQLState: 61000
 2011/07/04 11:20:06.475{UTC} [JDBCExceptionReporter :
JDBCExceptionReporter.java: logExceptions: 101] [RMI TCP
Connection(6)-10.50.53.32]:  ERROR: :  ORA-00060: deadlock detected while
waiting for resource
 2011/07/04 11:20:06.475{UTC} [AbstractFlushingEventListener :
AbstractFlushingEventListener.java: performExecutions: 324] [RMI TCP
Connection(6)-10.50.53.32]:  ERROR: :  Could not synchronize database state
with session
 org.hibernate.exception.LockAcquisitionException: could not delete:
[org.drools.persistence.processinstance.ProcessInstanceInfo#8130]
at
org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:112)..
 

--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools-Ruleflow-deadlock-issue-thread-tp3136706p3136706.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