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