@Test public void testDummyTMGetCache() throws Exception { ConfigurationBuilder cb = new ConfigurationBuilder(); cb.transaction().use1PcForAutoCommitTransactions(true) .transactionManagerLookup(new EmbeddedTransactionManagerLookup()); withCacheManager(new CacheManagerCallable(createCacheManager()) { @Override public void call() { cm.getCache(); } }); }
@Override protected ConfigurationBuilder configure() { ConfigurationBuilder config = super.configure(); config.transaction().transactionManagerLookup(new EmbeddedTransactionManagerLookup()) .clustering().cacheMode(CacheMode.REPL_SYNC); return config; } }
public void testOverride() { final ConfigurationBuilder c = new ConfigurationBuilder(); c.transaction().transactionMode(TransactionMode.TRANSACTIONAL) .transactionManagerLookup(new EmbeddedTransactionManagerLookup()); withCacheManager(new CacheManagerCallable(TestCacheManagerFactory.createCacheManager()){ @Override public void call() { cm.defineConfiguration("transactional", c.build()); Cache<?, ?> cache = cm.getCache("transactional"); assert cache.getCacheConfiguration().transaction().transactionMode().isTransactional(); } }); }
@Override protected EmbeddedCacheManager createCacheManager() throws Exception { ConfigurationBuilder c = getDefaultStandaloneCacheConfig(true); c.transaction().transactionManagerLookup(new EmbeddedTransactionManagerLookup()).useSynchronization(false).recovery().disable(); return TestCacheManagerFactory.createCacheManager(c); }
@Override protected void createCacheManagers() throws Throwable { ConfigurationBuilder config = getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC, true); config.clustering().hash().numOwners(1).transaction().transactionManagerLookup(new EmbeddedTransactionManagerLookup()); createCluster(config, 2); waitForClusterToForm(); }
@Override protected EmbeddedCacheManager createCacheManager() throws Exception { EmbeddedCacheManager cacheManager = TestCacheManagerFactory.createCacheManager(getDefaultStandaloneCacheConfig(true)); ConfigurationBuilder builder = getDefaultStandaloneCacheConfig(true); builder.transaction().useSynchronization(true); builder.transaction().transactionManagerLookup(new EmbeddedTransactionManagerLookup()); cacheManager.defineConfiguration(SYNC_CACHE_NAME, builder.build()); builder = getDefaultStandaloneCacheConfig(true); builder.transaction().useSynchronization(false); builder.transaction().transactionManagerLookup(new EmbeddedTransactionManagerLookup()); cacheManager.defineConfiguration(XA_CACHE_NAME, builder.build()); return cacheManager; }
@Override protected EmbeddedCacheManager createCacheManager() throws Exception { final ConfigurationBuilder config = getDefaultStandaloneCacheConfig(true); config.transaction().lockingMode(LockingMode.PESSIMISTIC) .transactionManagerLookup(new EmbeddedTransactionManagerLookup()) .useSynchronization(false) .recovery().disable(); return TestCacheManagerFactory.createCacheManager(config); }
@Override protected EmbeddedCacheManager createCacheManager() throws Exception { ConfigurationBuilder cb = new ConfigurationBuilder(); cb.transaction() .transactionMode(TransactionMode.TRANSACTIONAL) .useSynchronization(false) .transactionManagerLookup(new EmbeddedTransactionManagerLookup()) .recovery().enable(); return TestCacheManagerFactory.createCacheManager(cb); }
@Override protected EmbeddedCacheManager createCacheManager() throws Exception { final ConfigurationBuilder config = getDefaultStandaloneCacheConfig(true); config .transaction() .lockingMode(LockingMode.OPTIMISTIC) .transactionManagerLookup(new EmbeddedTransactionManagerLookup()) .useSynchronization(false) .recovery() .disable(); return TestCacheManagerFactory.createCacheManager(config); }
protected void createCacheManagers() throws Throwable { ConfigurationBuilder cfg = getDefaultClusteredCacheConfig(cacheMode, true); cfg.transaction().transactionManagerLookup(new EmbeddedTransactionManagerLookup()) .lockingMode(LockingMode.PESSIMISTIC) .locking().lockAcquisitionTimeout(TestingUtil.shortTimeoutMillis()); createClusteredCaches(2, "testcache", cfg); }
@Override protected void createCacheManagers() throws Throwable { c = getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC, true); c .transaction() .lockingMode(LockingMode.PESSIMISTIC) .transactionManagerLookup(new EmbeddedTransactionManagerLookup()) .clustering() .hash().numOwners(3); createCluster(c, 2); waitForClusterToForm(); }
@Override protected void createCacheManagers() throws Throwable { super.createCacheManagers(); ConfigurationBuilder builder = getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC); builder.clustering().partitionHandling().whenSplit(PartitionHandling.DENY_READ_WRITES); builder.transaction().lockingMode(LockingMode.OPTIMISTIC).transactionMode(TransactionMode.TRANSACTIONAL).transactionManagerLookup(new EmbeddedTransactionManagerLookup()); defineConfigurationOnAllManagers(OPTIMISTIC_TX_CACHE_NAME, builder); }
@Override protected void createCacheManagers() throws Throwable { dcc = getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC, true); dcc.transaction().transactionManagerLookup(new EmbeddedTransactionManagerLookup()); dcc.clustering().hash().numOwners(1); dcc.clustering().stateTransfer().fetchInMemoryState(true); createCluster(dcc, 2); waitForClusterToForm(); }
@Override protected void createCacheManagers() throws Throwable { ConfigurationBuilder builder = getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC, true); builder.transaction() .transactionManagerLookup(new EmbeddedTransactionManagerLookup()) .useSynchronization(false) .recovery().disable(); builder.clustering() .stateTransfer().fetchInMemoryState(true) .hash().numOwners(3); createClusteredCaches(4, builder); }
@Override protected EmbeddedCacheManager createCacheManager() throws Exception { ConfigurationBuilder builder = TestCacheManagerFactory.getDefaultCacheConfiguration(true); builder.locking().lockAcquisitionTimeout(TestingUtil.shortTimeoutMillis()); builder.invocationBatching().enable(); builder.locking().isolationLevel(IsolationLevel.READ_COMMITTED); builder.transaction().transactionManagerLookup(new EmbeddedTransactionManagerLookup()).lockingMode(lockingMode); return TestCacheManagerFactory.createCacheManager(builder); }
@Override protected void createCacheManagers() throws Throwable { ConfigurationBuilder configurationBuilder = getDefaultClusteredCacheConfig(CacheMode.REPL_SYNC, true); configurationBuilder.clustering().hash().numSegments(60).groups().enabled(); configurationBuilder.transaction() .transactionMode(TransactionMode.TRANSACTIONAL).transactionManagerLookup(new EmbeddedTransactionManagerLookup()) .lockingMode(LockingMode.PESSIMISTIC) .locking().lockAcquisitionTimeout(TestingUtil.shortTimeoutMillis()); createClusteredCaches(2, "atomic", configurationBuilder); }
@Override protected void createCacheManagers() throws Throwable { dccc = getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC, true, true); dccc.transaction() .transactionMode(TransactionMode.TRANSACTIONAL) .transactionManagerLookup(new EmbeddedTransactionManagerLookup()) .lockingMode(LockingMode.PESSIMISTIC); dccc.clustering().hash().numOwners(1).l1().disable(); dccc.locking().lockAcquisitionTimeout(TestingUtil.shortTimeoutMillis()); createCluster(dccc, CLUSTER_SIZE); waitForClusterToForm(); }
@Override protected void createCacheManagers() throws Throwable { cfgBuilder = getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC, true); cfgBuilder.transaction().transactionManagerLookup(new EmbeddedTransactionManagerLookup()); cfgBuilder.clustering().hash().numOwners(2); cfgBuilder.clustering().stateTransfer().fetchInMemoryState(true); cfgBuilder.clustering().stateTransfer().timeout(20000); gcfgBuilder = new GlobalConfigurationBuilder(); gcfgBuilder.transport().transport(mockTransport); }
@Override protected void createCacheManagers() throws Throwable { dccc = getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC, true, true); dccc.transaction().transactionManagerLookup(new EmbeddedTransactionManagerLookup()); dccc.clustering().hash().l1().disable().locking().lockAcquisitionTimeout(TestingUtil.shortTimeoutMillis()); dccc.clustering().stateTransfer().fetchInMemoryState(true); createCluster(dccc, 2); waitForClusterToForm(); }
@Override protected void createCacheManagers() throws Throwable { cfgBuilder = getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC, true); cfgBuilder.transaction().transactionManagerLookup(new EmbeddedTransactionManagerLookup()); cfgBuilder.clustering().hash().numOwners(2); cfgBuilder.clustering().stateTransfer().fetchInMemoryState(true); cfgBuilder.clustering().stateTransfer().timeout(20000); GlobalConfigurationBuilder gcb0 = new GlobalConfigurationBuilder().clusteredDefault(); addClusterEnabledCacheManager(gcb0, cfgBuilder, new TransportFlags().withFD(true)); GlobalConfigurationBuilder gcb1 = new GlobalConfigurationBuilder().clusteredDefault(); addClusterEnabledCacheManager(gcb1, cfgBuilder, new TransportFlags().withFD(true)); }