Bug 803831

Summary: Persistence fails when running multiple threads with exclusive EntityManager for each thread
Product: [JBoss] JBoss Enterprise BRMS Platform 5 Reporter: Jiri Svitak <jsvitak>
Component: jBPM 5Assignee: Marco Rietveld <mrietvel>
Status: CLOSED DUPLICATE QA Contact: Jiri Svitak <jsvitak>
Severity: high Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: atangrin, brms-jira, kverlaen, mbaluch, smcgowan
Target Milestone: ---   
Target Release: BRMS 5.3.0.GA   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-04-11 11:04:33 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
Stack trace none

Description Jiri Svitak 2012-03-15 17:55:36 UTC
Created attachment 570370 [details]
Stack trace

I have created a test which runs multiple threads in parallel. Each thread has its own ksession. Every thread uses its own EntityManager. Threads share the same database for persisting process instances, work items and session information.

If I use single entity manager which is shared by the threads, then everything is persisted fine.

I have attached error stack trace in file, because the stack trace is very long. This stack trace happened with MySQL database.

I have also tried local HSQL database, but the exception is a bit different and shorter.

I am working on a test case, it is available here
https://github.com/jsvitak/jbpm/blob/parallelProcessPersistence/jbpm-test/src/test/java/org/jbpm/persistence/ProcessMultiThreadPersistenceTest.java

But it is not finished and working yet. I am working on a pull request.

Comment 1 Marco Rietveld 2012-04-11 09:29:21 UTC
Jiri, 

It seems like this might be a duplicate of 805899. 

If this is not a duplicate, could you add some additional detail as to why the issue/cause here is different than in 805899? 

Thanks,
Marco

Comment 2 Marco Rietveld 2012-04-11 11:04:33 UTC
It turns out that 805899 covers this same issue, please see that issue for more information.

*** This bug has been marked as a duplicate of bug 805899 ***