/** * @return Cache configuration. * @throws Exception In case of error. */ protected CacheConfiguration cacheConfiguration() throws Exception { CacheConfiguration cfg = defaultCacheConfiguration(); cfg.setCacheMode(PARTITIONED); cfg.setBackups(1); cfg.setWriteSynchronizationMode(FULL_SYNC); cfg.setRebalanceMode(SYNC); return cfg; }