use of org.drools.persistence.map.KnowledgeSessionStorageEnvironmentBuilder in project drools by kiegroup.
the class MapBasedPersistenceTest method disposeAndReloadSession.
@Override
protected KieSession disposeAndReloadSession(KieSession ksession, KieBase kbase) {
long sessionId = ksession.getIdentifier();
ksession.dispose();
EnvironmentBuilder envBuilder = new KnowledgeSessionStorageEnvironmentBuilder(storage);
Environment env = KieServices.Factory.get().newEnvironment();
env.set(EnvironmentName.TRANSACTION_MANAGER, envBuilder.getTransactionManager());
env.set(EnvironmentName.PERSISTENCE_CONTEXT_MANAGER, envBuilder.getPersistenceContextManager());
return JPAKnowledgeService.loadStatefulKnowledgeSession(sessionId, kbase, null, env);
}
use of org.drools.persistence.map.KnowledgeSessionStorageEnvironmentBuilder in project drools by kiegroup.
the class MapBasedPersistenceTest method createSession.
@Override
protected KieSession createSession(KieBase kbase) {
EnvironmentBuilder envBuilder = new KnowledgeSessionStorageEnvironmentBuilder(storage);
Environment env = KieServices.Factory.get().newEnvironment();
env.set(EnvironmentName.TRANSACTION_MANAGER, envBuilder.getTransactionManager());
env.set(EnvironmentName.PERSISTENCE_CONTEXT_MANAGER, envBuilder.getPersistenceContextManager());
return JPAKnowledgeService.newStatefulKnowledgeSession(kbase, null, env);
}
Aggregations