config.setIsolationLevel(IsolationLevel.REPEATABLE_READ);
config.setSyncReplTimeout(20000);
config.setLockAcquisitionTimeout(15000);
config.setCacheMode(local ? CacheMode.LOCAL : (totalReplication ? CacheMode.REPL_SYNC : CacheMode.DIST_SYNC));
CacheMode mode = config.getCacheMode();
config.setFetchInMemoryState(mode.isReplicated());
// Block for commits -- no races between test driver and replication
config.setSyncCommitPhase(true);
config.setSyncRollbackPhase(true);
if (passivationDir != null)
{
CacheLoaderManagerConfig managerConfig = new CacheLoaderManagerConfig();
managerConfig.setPassivation(true);
managerConfig.setPreload(!purgeCacheLoader);
FileCacheStoreConfig fileConfig = new FileCacheStoreConfig();
fileConfig.setLocation(passivationDir);
fileConfig.setFetchPersistentState(mode.isReplicated());
fileConfig.setPurgeOnStartup(purgeCacheLoader);
managerConfig.setCacheLoaderConfigs(Collections.<CacheLoaderConfig>singletonList(fileConfig));
config.setCacheLoaderManagerConfig(managerConfig);