[jboss-user] [jBPM] - Re: jbpm5 Exception:Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [org.jbpm.persistence.processinstance.ProcessInstanceInfo#2]

Daniel Ch do-not-reply at jboss.com
Thu Jul 7 05:50:00 EDT 2011


Daniel Ch [http://community.jboss.org/people/danielch] created the discussion

"Re: jbpm5 Exception:Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [org.jbpm.persistence.processinstance.ProcessInstanceInfo#2]"

To view the discussion, visit: http://community.jboss.org/message/613878#613878

--------------------------------------------------------------
Hi,

I am facing the same problem and I want to provide more information.

My JBPM datasource: 

<datasources>
<xa-datasource>
        <jndi-name>JbpmDS</jndi-name>
        <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
        <xa-datasource-property name="URL">jdbc:oracle:thin:@HOST:1521:SCHEMA</xa-datasource-property>
        <xa-datasource-property name="User">USER</xa-datasource-property>
        <xa-datasource-property name="Password">PASSWORD</xa-datasource-property>
        <min-pool-size>1</min-pool-size>
        <max-pool-size>5</max-pool-size>
        <idle-timeout-minutes>0</idle-timeout-minutes>
        <prepared-statement-cache-size>32</prepared-statement-cache-size> 
        <metadata>
            <type-mapping>Hypersonic SQL</type-mapping>
        </metadata> 
</xa-datasource>


Persistence.xml:

<persistence>

    <persistence-unit name="org.jbpm.persistence.jpa" transaction-type="JTA">

        <provider>org.hibernate.ejb.HibernatePersistence</provider>
        <jta-data-source>java:JbpmDS</jta-data-source>
        <class>org.drools.persistence.info.SessionInfo</class>
        <class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>
        <class>org.drools.persistence.info.WorkItemInfo</class>
        <class>org.jbpm.process.audit.ProcessInstanceLog</class>
        <class>org.jbpm.process.audit.NodeInstanceLog</class>
        <class>org.jbpm.process.audit.VariableInstanceLog</class>

        <properties>
            <property name="hibernate.max_fetch_depth" value="3"/>
            <property name="hibernate.show_sql" value="true"/>
        </properties>
    </persistence-unit>
</persistence>


JBPM init process:

         @PersistenceUnit(name = "org.jbpm.persistence.jpa")
            private EntityManagerFactory emf;
          
          ...
 
             KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
            org.drools.io.Resource resource = ResourceFactory.newClassPathResource("Test.bpmn");
 
            env = KnowledgeBaseFactory.newEnvironment();
            kbuilder.add(resource, ResourceType.BPMN2);
            env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf);
            
            kbase = kbuilder.newKnowledgeBase();    
    
            session = JPAKnowledgeService.newStatefulKnowledgeSession(kbase, null, env);           
            JPAWorkingMemoryDbLogger logger = new JPAWorkingMemoryDbLogger(session);
 
            session.getWorkItemManager().registerWorkItemHandler("EjbCall", new EjbWorkItemHandler());
 


I want to use that single StatefulKnowledgeSession within my application (session should be threadsafe). 

ProcessInstance instance = session.startProcess("Test.bpmn", input);


Thats working for one single client request. However, by starting multiple request to that single Session I will get the described error and I guess it is a threading issue.  

Any suggestions or remarks?

Cheers
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/613878#613878]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110707/ff6018b3/attachment.html 


More information about the jboss-user mailing list