Package org.hibernate.cache

Examples of org.hibernate.cache.TransactionalDataRegion


        Configuration cfg = CacheTestUtil.buildConfiguration("test", SharedJBossCacheRegionFactory.class, true, false);
        cfg.setProperty(SharedCacheInstanceManager.CACHE_RESOURCE_PROP, CacheTestUtil.LOCAL_PESSIMISTIC_CACHE);
       
        JBossCacheRegionFactory regionFactory = CacheTestUtil.startRegionFactory(cfg, getCacheTestSupport());
       
        TransactionalDataRegion region = (TransactionalDataRegion) createRegion(regionFactory, "test/test", cfg.getProperties(), getCacheDataDescription());
       
        assertTrue("Region is transaction-aware", region.isTransactionAware());
       
        CacheTestUtil.stopRegionFactory(regionFactory, getCacheTestSupport());
       
        cfg = CacheTestUtil.buildConfiguration("test", SharedJBossCacheRegionFactory.class, true, false);
        cfg.setProperty(SharedCacheInstanceManager.CACHE_RESOURCE_PROP, CacheTestUtil.LOCAL_PESSIMISTIC_CACHE);
        // Make it non-transactional
        cfg.getProperties().remove(Environment.TRANSACTION_MANAGER_STRATEGY);
       
        regionFactory = CacheTestUtil.startRegionFactory(cfg, getCacheTestSupport());
       
        region = (TransactionalDataRegion) createRegion(regionFactory, "test/test", cfg.getProperties(), getCacheDataDescription());
       
        assertFalse("Region is not transaction-aware", region.isTransactionAware());
       
        CacheTestUtil.stopRegionFactory(regionFactory, getCacheTestSupport());
    }
View Full Code Here


        Configuration cfg = CacheTestUtil.buildConfiguration("test", SharedJBossCacheRegionFactory.class, true, false);
        cfg.setProperty(SharedCacheInstanceManager.CACHE_RESOURCE_PROP, CacheTestUtil.LOCAL_PESSIMISTIC_CACHE);
       
        JBossCacheRegionFactory regionFactory = CacheTestUtil.startRegionFactory(cfg, getCacheTestSupport());
       
        TransactionalDataRegion region = (TransactionalDataRegion) createRegion(regionFactory, "test/test", cfg.getProperties(), getCacheDataDescription());
       
        CacheDataDescription cdd = region.getCacheDataDescription();
       
        assertNotNull(cdd);
       
        CacheDataDescription expected = getCacheDataDescription();
        assertEquals(expected.isMutable(), cdd.isMutable());
View Full Code Here

        Configuration cfg = CacheTestUtil.buildConfiguration("test", SharedJBossCacheRegionFactory.class, true, false);
        cfg.setProperty(SharedCacheInstanceManager.CACHE_RESOURCE_PROP, CacheTestUtil.LOCAL_PESSIMISTIC_CACHE);
       
        JBossCacheRegionFactory regionFactory = CacheTestUtil.startRegionFactory(cfg, getCacheTestSupport());
       
        TransactionalDataRegion region = (TransactionalDataRegion) createRegion(regionFactory, "test/test", cfg.getProperties(), getCacheDataDescription());
       
        assertTrue("Region is transaction-aware", region.isTransactionAware());
       
        CacheTestUtil.stopRegionFactory(regionFactory, getCacheTestSupport());
       
        cfg = CacheTestUtil.buildConfiguration("test", SharedJBossCacheRegionFactory.class, true, false);
        cfg.setProperty(SharedCacheInstanceManager.CACHE_RESOURCE_PROP, CacheTestUtil.LOCAL_PESSIMISTIC_CACHE);
        // Make it non-transactional
        cfg.getProperties().remove(Environment.TRANSACTION_MANAGER_STRATEGY);
       
        regionFactory = CacheTestUtil.startRegionFactory(cfg, getCacheTestSupport());
       
        region = (TransactionalDataRegion) createRegion(regionFactory, "test/test", cfg.getProperties(), getCacheDataDescription());
       
        assertFalse("Region is not transaction-aware", region.isTransactionAware());
       
        CacheTestUtil.stopRegionFactory(regionFactory, getCacheTestSupport());
    }
View Full Code Here

        Configuration cfg = CacheTestUtil.buildConfiguration("test", SharedJBossCacheRegionFactory.class, true, false);
        cfg.setProperty(SharedCacheInstanceManager.CACHE_RESOURCE_PROP, CacheTestUtil.LOCAL_PESSIMISTIC_CACHE);
       
        JBossCacheRegionFactory regionFactory = CacheTestUtil.startRegionFactory(cfg, getCacheTestSupport());
       
        TransactionalDataRegion region = (TransactionalDataRegion) createRegion(regionFactory, "test/test", cfg.getProperties(), getCacheDataDescription());
       
        CacheDataDescription cdd = region.getCacheDataDescription();
       
        assertNotNull(cdd);
       
        CacheDataDescription expected = getCacheDataDescription();
        assertEquals(expected.isMutable(), cdd.isMutable());
View Full Code Here

    * @throws Exception
    */
   public void testIsTransactionAware() throws Exception {
      Configuration cfg = CacheTestUtil.buildConfiguration("test", InfinispanRegionFactory.class, true, false);
      InfinispanRegionFactory regionFactory = CacheTestUtil.startRegionFactory(cfg, getCacheTestSupport());
      TransactionalDataRegion region = (TransactionalDataRegion) createRegion(regionFactory, "test/test", cfg.getProperties(), getCacheDataDescription());
      assertTrue("Region is transaction-aware", region.isTransactionAware());
      CacheTestUtil.stopRegionFactory(regionFactory, getCacheTestSupport());
      cfg = CacheTestUtil.buildConfiguration("test", InfinispanRegionFactory.class, true, false);
      // Make it non-transactional
      cfg.getProperties().remove(Environment.TRANSACTION_MANAGER_STRATEGY);
      regionFactory = CacheTestUtil.startRegionFactory(cfg, getCacheTestSupport());
      region = (TransactionalDataRegion) createRegion(regionFactory, "test/test", cfg.getProperties(), getCacheDataDescription());
      assertFalse("Region is not transaction-aware", region.isTransactionAware());
      CacheTestUtil.stopRegionFactory(regionFactory, getCacheTestSupport());
   }
View Full Code Here

   }

   public void testGetCacheDataDescription() throws Exception {
      Configuration cfg = CacheTestUtil.buildConfiguration("test", InfinispanRegionFactory.class, true, false);
      InfinispanRegionFactory regionFactory = CacheTestUtil.startRegionFactory(cfg, getCacheTestSupport());
      TransactionalDataRegion region = (TransactionalDataRegion) createRegion(regionFactory, "test/test", cfg.getProperties(), getCacheDataDescription());
      CacheDataDescription cdd = region.getCacheDataDescription();
      assertNotNull(cdd);
      CacheDataDescription expected = getCacheDataDescription();
      assertEquals(expected.isMutable(), cdd.isMutable());
      assertEquals(expected.isVersioned(), cdd.isVersioned());
      assertEquals(expected.getVersionComparator(), cdd.getVersionComparator());
View Full Code Here

TOP

Related Classes of org.hibernate.cache.TransactionalDataRegion

Copyright © 2018 www.massapicom. 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.