JBoss Community

Re: [JBPM 5.4] - Transaction / Concurrency problem

created by Maciej Swiderski in jBPM - View the full discussion

if you have mulitple ksessions that different threads operate on you cannot share the environment object. Each session must have dedicated instance of Environment and looking at the code given you share environment.

 

 

Guilherme Telles wrote:

My Environment:

 

    public Environment getEnvironment() {
 
        if(environment == null) {
            LOGGER.info("CREATING NEW ENVIRONMENT");
 
            environment = KnowledgeBaseFactory.newEnvironment();
            environment.set(EnvironmentName.ENTITY_MANAGER_FACTORY, getEntityManagerFactoryJbpm());
        }
        return environment;
    }

 

HTH

Reply to this message by going to Community

Start a new discussion in jBPM at Community