Gábor Farkas [https://community.jboss.org/people/hhcofcmds] created the 
discussion

"Re: Session and thread safety"

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

--------------------------------------------------------------
The same problem here, still exists in JBpm5, 5.3.0.Final
The problem is that SingleSessionCommandService calls 
beginCommandScopedEntityManager on the PersistenceContextManager, but the 
endCommandScopedEntityManager in called when the transaction commits. When used 
in an EE environment, the JTA transaction commits well after the 
SingleSessionCommandService exits the synchronized block.
If another requests comes, and the execution enter the critical section, the 
CMD_SCOPED_ENTITY_MANAGER is still stored in the environment, so the new 
request will just use the EntityManager from the previous request, which 
clearly causes serious problems.
I think that this should be reportes as a bug in Jbpm5, because this prevents 
the correct usage of JBpm in an enterprise container. What do you think?
In my workaround, I created a CDI interceptor that synchronizes methods that 
use KnowledgeSession on a higher level.
--------------------------------------------------------------

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

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
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to