dbSqlSessionFactory.setDbHistoryUsed(isDbHistoryUsed);
dbSqlSessionFactory.setDatabaseTablePrefix(databaseTablePrefix);
dbSqlSessionFactory.setDatabaseSchema(databaseSchema);
addSessionFactory(dbSqlSessionFactory);
addSessionFactory(new GenericManagerFactory(AttachmentManager.class));
addSessionFactory(new GenericManagerFactory(CommentManager.class));
addSessionFactory(new GenericManagerFactory(DeploymentManager.class));
addSessionFactory(new GenericManagerFactory(ModelManager.class));
addSessionFactory(new GenericManagerFactory(ExecutionManager.class));
addSessionFactory(new GenericManagerFactory(HistoricActivityInstanceManager.class));
addSessionFactory(new GenericManagerFactory(HistoricDetailManager.class));
addSessionFactory(new GenericManagerFactory(HistoricProcessInstanceManager.class));
addSessionFactory(new GenericManagerFactory(HistoricVariableInstanceManager.class));
addSessionFactory(new GenericManagerFactory(HistoricTaskInstanceManager.class));
addSessionFactory(new GenericManagerFactory(IdentityInfoManager.class));
addSessionFactory(new GenericManagerFactory(IdentityLinkManager.class));
addSessionFactory(new GenericManagerFactory(JobManager.class));
addSessionFactory(new GenericManagerFactory(GroupManager.class));
addSessionFactory(new GenericManagerFactory(MembershipManager.class));
addSessionFactory(new GenericManagerFactory(ProcessDefinitionManager.class));
addSessionFactory(new GenericManagerFactory(PropertyManager.class));
addSessionFactory(new GenericManagerFactory(ResourceManager.class));
addSessionFactory(new GenericManagerFactory(ByteArrayManager.class));
addSessionFactory(new GenericManagerFactory(TableDataManager.class));
addSessionFactory(new GenericManagerFactory(TaskManager.class));
addSessionFactory(new GenericManagerFactory(UserManager.class));
addSessionFactory(new GenericManagerFactory(VariableInstanceManager.class));
addSessionFactory(new GenericManagerFactory(EventSubscriptionManager.class));
addSessionFactory(new GenericManagerFactory(HistoryManager.class));
}
if (customSessionFactories!=null) {
for (SessionFactory sessionFactory: customSessionFactories) {
addSessionFactory(sessionFactory);
}