@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 void createCacheManagers() throws Throwable { ConfigurationBuilder dcc = getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC, true); dcc.transaction().use1PcForAutoCommitTransactions(true); dcc.clustering().hash().numOwners(1); createCluster(dcc, 2); waitForClusterToForm(); }
@Override protected void createCacheManagers() throws Throwable { ConfigurationBuilder c = getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC, true); c.transaction().use1PcForAutoCommitTransactions(true); createCluster(c, 2); waitForClusterToForm(); ic0 = new InvocationCountInterceptor(); advancedCache(0).addInterceptor(ic0, 1); ic1 = new InvocationCountInterceptor(); advancedCache(1).addInterceptor(ic1, 1); }
break; case USE_1PC_FOR_AUTOCOMMIT_TX: builder.transaction().use1PcForAutoCommitTransactions(Boolean.parseBoolean(value)); break; case REAPER_WAKE_UP_INTERVAL:
.use1PcForAutoCommitTransactions(false).autoCommit(false);
.use1PcForAutoCommitTransactions(false).autoCommit(false);
@Override protected EmbeddedCacheManager createCacheManager() throws Exception { ConfigurationBuilder cfg = getDefaultStandaloneCacheConfig(true); cfg .customInterceptors() .addInterceptor() .after(EntryWrappingInterceptor.class) .interceptor(nastyInterceptor) .transaction() .transactionMode(TransactionMode.TRANSACTIONAL) .use1PcForAutoCommitTransactions(false) .indexing() .index(Index.ALL) .addIndexedEntity(Person.class) .addProperty("default.directory_provider", "local-heap") .addProperty("lucene_version", "LUCENE_CURRENT") .locking().isolationLevel(IsolationLevel.READ_COMMITTED); return TestCacheManagerFactory.createCacheManager(cfg); }
configuration.invocationBatching().enable(); if (onePhaseCommitOptimization) { configuration.transaction().use1PcForAutoCommitTransactions(true);