Package org.infinispan.configuration.cache

Examples of org.infinispan.configuration.cache.ConfigurationBuilder.invocationBatching()


        GlobalConfigurationBuilder globalConfigurationBuilder = new GlobalConfigurationBuilder();
        globalConfigurationBuilder.transport().transport(null).serialization().addAdvancedExternalizer(Schematic.externalizers());

        ConfigurationBuilder configurationBuilder = new ConfigurationBuilder();
        configurationBuilder.invocationBatching().enable().transaction()
                            .transactionManagerLookup(new DummyTransactionManagerLookup()).lockingMode(LockingMode.PESSIMISTIC)
                            .locking().isolationLevel(IsolationLevel.READ_COMMITTED);
        configurationBuilder.persistence().addStore(LevelDBStoreConfigurationBuilder.class)
                            .implementationType(LevelDBStoreConfiguration.ImplementationType.JAVA)
                            .location("target/leveldb/store").expiredLocation("target/leveldb/expired").purgeOnStartup(true);
View Full Code Here


    @Before
    public void beforeEach() {
        logger = Logger.getLogger(getClass());
        ConfigurationBuilder configurationBuilder = new ConfigurationBuilder();
        configurationBuilder.invocationBatching().enable().transaction()
                            .transactionManagerLookup(new DummyTransactionManagerLookup()).lockingMode(LockingMode.PESSIMISTIC);

        cm = TestCacheManagerFactory.createCacheManager(configurationBuilder);
        // Now create the SchematicDb ...
        schematicDb = Schematic.get(cm, "documents");
View Full Code Here

    @SuppressWarnings( {"rawtypes", "unchecked"} )
    @Before
    public void beforeTest() {
        ConfigurationBuilder configurationBuilder = new ConfigurationBuilder();
        configurationBuilder.invocationBatching().enable().transaction()
                            .transactionManagerLookup(new DummyTransactionManagerLookup());

        cm = TestCacheManagerFactory.createCacheManager(configurationBuilder);
        cache = (AdvancedCache)cm.getCache("documents");
        db = new CacheSchematicDb(cache);
View Full Code Here

   protected abstract String getJoiningNodeConfig();
  
   protected Cache<String, String> getReplicatedCache(EmbeddedCacheManager manager) throws Exception {
      ConfigurationBuilder cacheConfig = new ConfigurationBuilder();
      cacheConfig.transaction().lockingMode(LockingMode.PESSIMISTIC);
      cacheConfig.invocationBatching().enable();
      cacheConfig.jmxStatistics().disable();
      cacheConfig.clustering().cacheMode(CacheMode.REPL_SYNC);

      manager.defineConfiguration(CACHE_NAME, cacheConfig.build());
      Cache<String, String> replicatedCache = manager.getCache(CACHE_NAME);
View Full Code Here

      assert getOnDifferentThread(cache, "k2") == null;
   }

   private Cache<String, String> createCache(String name) {
      ConfigurationBuilder c = TestCacheManagerFactory.getDefaultCacheConfiguration(true);
      c.invocationBatching().enable();
      cm.defineConfiguration(name, c.build());
      return cm.getCache(name);
   }
}
View Full Code Here

   EmbeddedCacheManager cm;

   @BeforeClass
   public void createCacheManager() {
      final ConfigurationBuilder defaultConfiguration = TestCacheManagerFactory.getDefaultCacheConfiguration(true);
      defaultConfiguration.invocationBatching().enable().transaction().autoCommit(false);
      cm = TestCacheManagerFactory.createCacheManager(defaultConfiguration);
   }

   @AfterClass
   public void destroyCacheManager() {
View Full Code Here

      assert getOnDifferentThread(cache, "k2") == null;
   }

   private Cache<String, String> createCache(boolean enableBatch, String name) {
      ConfigurationBuilder c = new ConfigurationBuilder();
      c.invocationBatching().enable(enableBatch);
      cm.defineConfiguration(name, c.build());
      return cm.getCache(name);
   }
}
View Full Code Here

   }

   private Cache<String, String> createCache(String name) {
      ConfigurationBuilder c = new ConfigurationBuilder();
      c.transaction().transactionManagerLookup(new MyDummyTransactionManagerLookup());
      c.invocationBatching().enable();
      c.transaction().transactionMode(TransactionMode.TRANSACTIONAL);
      cm.defineConfiguration(name, c.build());
      return cm.getCache(name);
   }
View Full Code Here

   @Override
   protected EmbeddedCacheManager createCacheManager() throws Exception {
      ConfigurationBuilder dccc = getDefaultClusteredCacheConfig(CacheMode.LOCAL, false);
      dccc.transaction().transactionMode(TransactionMode.TRANSACTIONAL).lockingMode(LockingMode.PESSIMISTIC);
      dccc.invocationBatching().enable(true);
      return TestCacheManagerFactory.createCacheManager(dccc);
   }

   public void testLockWithBatchingRollback() {
      cache.startBatch();
View Full Code Here

         // we also need to use repeatable read for tests to work when we dont have reliable return values, since the
         // tests repeatedly queries changes
         configuration.locking().isolationLevel(IsolationLevel.REPEATABLE_READ);
      }
      if (tx) {
         configuration.invocationBatching().enable();
         if (onePhaseCommitOptimization) {
            configuration.transaction().use1PcForAutoCommitTransactions(true);
         }
      }
      if (sync) configuration.clustering().sync().replTimeout(60, TimeUnit.SECONDS);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.