in drools-benchmarks-parent/drools-benchmarks-reliability/src/main/java/org/drools/benchmarks/reliability/InsertFailoverFireBenchmark.java [65:90]
public void setupAndFailover() {
// System.out.println("setupAndFailover!!");
if (mode != Mode.NONE) {
persistenceStrategy = PersistedSessionOption.PersistenceStrategy.STORES_ONLY;
safepointStrategy = useSafepoints ? PersistedSessionOption.SafepointStrategy.AFTER_FIRE : PersistedSessionOption.SafepointStrategy.ALWAYS;
persistenceObjectsStrategy = useObjectStoreWithReferences ? PersistedSessionOption.PersistenceObjectsStrategy.OBJECT_REFERENCES : PersistedSessionOption.PersistenceObjectsStrategy.SIMPLE;
// These 3 strategies will not change during the benchmark
PersistedSessionOption persistedSessionOption = PersistedSessionOption.newSession()
.withPersistenceStrategy(persistenceStrategy)
.withSafepointStrategy(safepointStrategy)
.withPersistenceObjectsStrategy(persistenceObjectsStrategy);
kieSession = createKieSession(persistedSessionOption);
} else {
kieSession = RuntimeUtil.createKieSession(kieBase);
}
populateKieSessionPerIteration();
kieSession.fireAllRules();
// failover
failover();
// recreate kieBase
setupKieBase();
}