protected void createCacheManagers() throws Throwable { ConfigurationBuilder builder = getDefaultClusteredCacheConfig(CacheMode.REPL_SYNC, true); builder.locking().isolationLevel(IsolationLevel.SERIALIZABLE) // TODO: Another case of default values changed (see ISPN-2651) .transaction().useSynchronization(false); List<Cache<Object, Object>> caches = createClusteredCaches(2, "cache", builder); cache1 = caches.get(0); cache2 = caches.get(1); }
private ConfigurationBuilder getBaseCfg() { ConfigurationBuilder cfg = new ConfigurationBuilder(); cfg.locking().concurrencyLevel(5000).transaction().transactionManagerLookup(new JBossStandaloneJTAManagerLookup()); return cfg; }
@Override protected EmbeddedCacheManager createCacheManager() throws Exception { ConfigurationBuilder builder = TestCacheManagerFactory.getDefaultCacheConfiguration(true); builder.locking().isolationLevel(IsolationLevel.REPEATABLE_READ) .transaction().lockingMode(LockingMode.OPTIMISTIC); return TestCacheManagerFactory.createCacheManager(builder); }
private ConfigurationBuilder defaultConfigurationBuilder() { ConfigurationBuilder builder = TestCacheManagerFactory.getDefaultCacheConfiguration(true); builder.clustering().cacheMode(getCacheMode()) .locking().isolationLevel(IsolationLevel.REPEATABLE_READ) .transaction().lockingMode(LockingMode.OPTIMISTIC); return builder; }
@Override protected ConfigurationBuilder createConfigurationBuilder() { ConfigurationBuilder cb = new ConfigurationBuilder(); cb.invocationBatching().enable() .locking().lockAcquisitionTimeout(TestingUtil.shortTimeoutMillis()) .isolationLevel(IsolationLevel.REPEATABLE_READ) .transaction().lockingMode(LockingMode.PESSIMISTIC); return cb; }
@Override protected ConfigurationBuilder createConfigurationBuilder() { ConfigurationBuilder cb = new ConfigurationBuilder(); cb.invocationBatching().enable() .locking().lockAcquisitionTimeout(TestingUtil.shortTimeoutMillis()) .isolationLevel(IsolationLevel.REPEATABLE_READ) .transaction().lockingMode(LockingMode.OPTIMISTIC); return cb; } }
@Override protected void createCacheManagers() throws Throwable { ConfigurationBuilder cfg = getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC, true); cfg .locking().lockAcquisitionTimeout(TestingUtil.shortTimeoutMillis()) .transaction().lockingMode(LockingMode.PESSIMISTIC); EmbeddedCacheManager cm1 = TestCacheManagerFactory.createClusteredCacheManager(cfg); EmbeddedCacheManager cm2 = TestCacheManagerFactory.createClusteredCacheManager(cfg); registerCacheManager(cm1, cm2); c1 = cm1.getCache(); c2 = cm2.getCache(); }
@Override protected void createCacheManagers() throws Throwable { ConfigurationBuilder dcc = getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC, true); dcc.clustering().hash().numOwners(1).l1().disable(); dcc.locking().transaction().transactionMode(TransactionMode.TRANSACTIONAL); createCluster(dcc, 4); waitForClusterToForm(); }
protected ConfigurationBuilder configure() { ConfigurationBuilder configuration = getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC, true); configuration.locking().useLockStriping(false) .transaction().transactionManagerLookup(new EmbeddedTransactionManagerLookup()) .useSynchronization(false) .recovery().enable() .clustering().stateTransfer().fetchInMemoryState(false); return configuration; }
@BeforeMethod public void setUp() { LockTestData ltd = new LockTestData(); ConfigurationBuilder defaultCfg = TestCacheManagerFactory.getDefaultCacheConfiguration(true); defaultCfg .locking() .isolationLevel(repeatableRead ? IsolationLevel.REPEATABLE_READ : IsolationLevel.READ_COMMITTED) .lockAcquisitionTimeout(TestingUtil.shortTimeoutMillis()) .transaction() .transactionManagerLookup(new EmbeddedTransactionManagerLookup()); cm = TestCacheManagerFactory.createCacheManager(defaultCfg); ltd.cache = cm.getCache(); ltd.lockManager = TestingUtil.extractComponentRegistry(ltd.cache).getComponent(LockManager.class); ltd.tm = (EmbeddedTransactionManager) TestingUtil.extractComponentRegistry(ltd.cache).getComponent(TransactionManager.class); lockTestData = ltd; }
@Override protected void createCacheManagers() throws Throwable { builder = TestCacheManagerFactory.getDefaultCacheConfiguration(true); builder.clustering().cacheMode(CacheMode.DIST_SYNC).l1().disable() .locking().isolationLevel(IsolationLevel.REPEATABLE_READ) .transaction().lockingMode(LockingMode.OPTIMISTIC); amendConfig(builder); createCluster(builder, 4); waitForClusterToForm(); }
@Override protected void createCacheManagers() throws Throwable { ConfigurationBuilder builder = TestCacheManagerFactory.getDefaultCacheConfiguration(true); builder.clustering().cacheMode(getCacheMode()) .locking().isolationLevel(IsolationLevel.REPEATABLE_READ).lockAcquisitionTimeout(TestingUtil.shortTimeoutMillis()) .transaction().lockingMode(LockingMode.OPTIMISTIC); decorate(builder); createCluster(builder, 2); waitForClusterToForm(); }
@Override protected void createCacheManagers() throws Throwable { builder = TestCacheManagerFactory.getDefaultCacheConfiguration(true); builder.clustering().cacheMode(CacheMode.REPL_SYNC) .locking().isolationLevel(IsolationLevel.REPEATABLE_READ) .transaction().lockingMode(LockingMode.OPTIMISTIC) .recovery().disable(); if (totalOrder) { builder.transaction().transactionProtocol(TransactionProtocol.TOTAL_ORDER); } createCluster(builder, 2); waitForClusterToForm(); }
@Override protected void createCacheManagers() throws Throwable { final ConfigurationBuilder conf = getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC, true); conf.clustering().hash().numOwners(1) .locking().isolationLevel(isolation) .transaction() .lockingMode(LockingMode.OPTIMISTIC) .transactionManagerLookup(new EmbeddedTransactionManagerLookup()); createCluster(conf, 2); waitForClusterToForm(); k0 = getKeyForCache(0); k1 = getKeyForCache(1); }
@Override protected EmbeddedCacheManager createCacheManager() throws Exception { cacheManager = TestCacheManagerFactory.createCacheManagerEnforceJmxDomain(JMX_DOMAIN); ConfigurationBuilder configuration = getDefaultStandaloneCacheConfig(true); configuration .jmxStatistics().enable() .locking() .concurrencyLevel(CONCURRENCY_LEVEL) .useLockStriping(true) .transaction() .transactionManagerLookup(new EmbeddedTransactionManagerLookup()); cacheManager.defineConfiguration("test", configuration.build()); cache = cacheManager.getCache("test"); lockManagerObjName = getCacheObjectName(JMX_DOMAIN, "test(local)", "LockManager"); threadMBeanServer = PerThreadMBeanServerLookup.getThreadMBeanServer(); return cacheManager; }
@Override protected void createCacheManagers() { ConfigurationBuilder configuration = getDefaultClusteredCacheConfig(CacheMode.REPL_SYNC, true); configuration.locking() .isolationLevel(IsolationLevel.REPEATABLE_READ) .lockAcquisitionTimeout(60000L) .transaction().transactionManagerLookup(new EmbeddedTransactionManagerLookup()); createClusteredCaches(2, "syncReplCache", configuration); waitForClusterToForm("syncReplCache"); ConfigurationBuilder noTx = getDefaultClusteredCacheConfig(CacheMode.REPL_SYNC, false); noTx.locking() .isolationLevel(IsolationLevel.REPEATABLE_READ) .lockAcquisitionTimeout(60000L); defineConfigurationOnAllManagers("syncReplCacheNoTx", noTx); ConfigurationBuilder replAsyncNoTx = getDefaultClusteredCacheConfig(CacheMode.REPL_ASYNC, false); defineConfigurationOnAllManagers("asyncReplCacheNoTx", replAsyncNoTx); }
@Override protected void createCacheManagers() throws Throwable { ConfigurationBuilder configuration = getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC, true); configuration .locking() .useLockStriping(false) .transaction() .transactionManagerLookup(new EmbeddedTransactionManagerLookup()) .useSynchronization(false) .recovery() .enable() .clustering() .stateTransfer() .fetchInMemoryState(false) .hash() .numOwners(3); createCluster(configuration, 4); waitForClusterToForm(); }
@Override protected void createCacheManagers() throws Throwable { ConfigurationBuilder configuration = getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC, true); configuration .locking() .useLockStriping(false) .transaction() .transactionManagerLookup(new EmbeddedTransactionManagerLookup()) .useSynchronization(false) .recovery() .disable() .clustering() .stateTransfer() .fetchInMemoryState(false) .hash() .numOwners(3); createCluster(configuration, 4); waitForClusterToForm(); }
@Override protected void createCacheManagers() { ConfigurationBuilder cfg = new ConfigurationBuilder(); cfg.clustering().cacheMode(CacheMode.REPL_SYNC) .locking() .concurrencyLevel(10000) .isolationLevel(IsolationLevel.REPEATABLE_READ) .lockAcquisitionTimeout(TestingUtil.shortTimeoutMillis()) .useLockStriping(false) .transaction() .transactionMode(TransactionMode.TRANSACTIONAL) .lockingMode(LockingMode.PESSIMISTIC) .transactionManagerLookup(new EmbeddedTransactionManagerLookup()) .recovery().enable(); registerCacheManager(TestCacheManagerFactory.createClusteredCacheManager(cfg), TestCacheManagerFactory.createClusteredCacheManager(cfg)); }
@Override protected void createCacheManagers() throws Throwable { ConfigurationBuilder configuration = getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC, true); configuration .locking().useLockStriping(false) .transaction() .transactionManagerLookup(new EmbeddedTransactionManagerLookup()) .useSynchronization(false) .recovery().enable() .clustering().stateTransfer().fetchInMemoryState(false); createCluster(configuration, 2); waitForClusterToForm(); ComponentRegistry componentRegistry = this.cache(0).getAdvancedCache().getComponentRegistry(); XaTransactionTable txTable = (XaTransactionTable) componentRegistry.getComponent(TransactionTable.class); TestingUtil.replaceField( new RecoveryManagerDelegate(TestingUtil.extractComponent(cache(0), RecoveryManager.class)), "recoveryManager", txTable, XaTransactionTable.class); }