Jason J [https://community.jboss.org/people/jasonjho] created the discussion

"Multiple sessions and thread safety using jBPM persistence"

To view the discussion, visit: https://community.jboss.org/message/773528#773528

--------------------------------------------------------------
For every workflow process I am creating a *new* separate kbase/ksession.   So 
every flow is bound to a unique session and *not* shared.

I have enabled JPA persistence and pass in the following env to *each* new 
session:


env = KnowledgeBaseFactory.newEnvironment();
env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf);
env.set(EnvironmentName.TRANSACTION_MANAGER, 
TransactionManagerServices.getTransactionManager());
session = createNewSession(env)
session.startProcess(...)




I am getting Hibernate StaleObjectExceptions and OptimisticLocking errors when 
I perform multiple operations on different processes.
I am not sure what specific DB operation is causing this, but since each 
process is in its own KSession - how is this even possible?

What database update could be in contention between 2 threads in this case?

I am using jBPM5.2.

Any ideas???
--------------------------------------------------------------

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

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

_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to