Search in sources :

Example 1 with DbEntityCache

use of org.camunda.bpm.engine.impl.db.entitymanager.cache.DbEntityCache in project camunda-bpm-platform by camunda.

the class DbEntityManager method initializeEntityCache.

protected void initializeEntityCache() {
    final JobExecutorContext jobExecutorContext = Context.getJobExecutorContext();
    final ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
    if (processEngineConfiguration != null && processEngineConfiguration.isDbEntityCacheReuseEnabled() && jobExecutorContext != null) {
        dbEntityCache = jobExecutorContext.getEntityCache();
        if (dbEntityCache == null) {
            dbEntityCache = new DbEntityCache(processEngineConfiguration.getDbEntityCacheKeyMapping());
            jobExecutorContext.setEntityCache(dbEntityCache);
        }
    } else {
        if (processEngineConfiguration != null) {
            dbEntityCache = new DbEntityCache(processEngineConfiguration.getDbEntityCacheKeyMapping());
        } else {
            dbEntityCache = new DbEntityCache();
        }
    }
}
Also used : JobExecutorContext(org.camunda.bpm.engine.impl.jobexecutor.JobExecutorContext) DbEntityCache(org.camunda.bpm.engine.impl.db.entitymanager.cache.DbEntityCache) ProcessEngineConfigurationImpl(org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl)

Aggregations

ProcessEngineConfigurationImpl (org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl)1 DbEntityCache (org.camunda.bpm.engine.impl.db.entitymanager.cache.DbEntityCache)1 JobExecutorContext (org.camunda.bpm.engine.impl.jobexecutor.JobExecutorContext)1