Package org.hibernate.cache

Examples of org.hibernate.cache.EntityRegion.buildAccessStrategy()


        }
        catch (UnsupportedOperationException good) {}
       
        try
        {
            region.buildAccessStrategy(AccessType.NONSTRICT_READ_WRITE);
            fail("Incorrectly got NONSTRICT_READ_WRITE");
        }
        catch (CacheException good) {}
       
        try
View Full Code Here


        }
        catch (CacheException good) {}
       
        try
        {
            region.buildAccessStrategy(AccessType.READ_WRITE);
            fail("Incorrectly got READ_WRITE");
        }
        catch (CacheException good) {}     
       
    }
View Full Code Here

      if ( accessStrategy == null && settings.isSecondLevelCacheEnabled() ) {
        final AccessType accessType = AccessType.parse( model.getCacheConcurrencyStrategy() );
        if ( accessType != null ) {
          log.trace( "Building cache for entity data [" + model.getEntityName() + "]" );
          EntityRegion entityRegion = settings.getRegionFactory().buildEntityRegion( cacheRegionName, properties, CacheDataDescriptionImpl.decode( model ) );
          accessStrategy = entityRegion.buildAccessStrategy( accessType );
          entityAccessStrategies.put( cacheRegionName, accessStrategy );
          allCacheRegions.put( cacheRegionName, entityRegion );
        }
      }
      EntityPersister cp = PersisterFactory.createClassPersister( model, accessStrategy, this, mapping );
View Full Code Here

   }

   @Override
   protected void supportedAccessTypeTest(RegionFactory regionFactory, Properties properties) {
      EntityRegion region = regionFactory.buildEntityRegion("test", properties, null);
      assertNull("Got TRANSACTIONAL", region.buildAccessStrategy(AccessType.TRANSACTIONAL)
               .lockRegion());
      try {
         region.buildAccessStrategy(AccessType.READ_ONLY).lockRegion();
         fail("Did not get READ_ONLY");
      } catch (UnsupportedOperationException good) {
View Full Code Here

   protected void supportedAccessTypeTest(RegionFactory regionFactory, Properties properties) {
      EntityRegion region = regionFactory.buildEntityRegion("test", properties, null);
      assertNull("Got TRANSACTIONAL", region.buildAccessStrategy(AccessType.TRANSACTIONAL)
               .lockRegion());
      try {
         region.buildAccessStrategy(AccessType.READ_ONLY).lockRegion();
         fail("Did not get READ_ONLY");
      } catch (UnsupportedOperationException good) {
      }

      try {
View Full Code Here

         fail("Did not get READ_ONLY");
      } catch (UnsupportedOperationException good) {
      }

      try {
         region.buildAccessStrategy(AccessType.NONSTRICT_READ_WRITE);
         fail("Incorrectly got NONSTRICT_READ_WRITE");
      } catch (CacheException good) {
      }

      try {
View Full Code Here

         fail("Incorrectly got NONSTRICT_READ_WRITE");
      } catch (CacheException good) {
      }

      try {
         region.buildAccessStrategy(AccessType.READ_WRITE);
         fail("Incorrectly got READ_WRITE");
      } catch (CacheException good) {
      }
   }
View Full Code Here

          
           // Sleep a bit to avoid concurrent FLUSH problem
           avoidConcurrentFlush();
          
           EntityRegion localEntityRegion = rf.buildEntityRegion(REGION_NAME, cfg.getProperties(), null);
           setEntityRegionAccessStrategy(localEntityRegion.buildAccessStrategy(getAccessType()));
       }
   }

   protected void tearDown() throws Exception {
      
View Full Code Here

           
            // Sleep a bit to avoid concurrent FLUSH problem
            avoidConcurrentFlush();
           
            EntityRegion localEntityRegion = rf.buildEntityRegion(REGION_NAME, cfg.getProperties(), null);
            setEntityRegionAccessStrategy(localEntityRegion.buildAccessStrategy(getAccessType()));
        }
    }

    protected void tearDown() throws Exception {
       
View Full Code Here

    @Override
    protected void supportedAccessTypeTest(RegionFactory regionFactory, Properties properties) {
       
        EntityRegion region = regionFactory.buildEntityRegion("test", properties, null);
       
        assertNull("Got TRANSACTIONAL", region.buildAccessStrategy(AccessType.TRANSACTIONAL).lockRegion());
       
        try
        {
            region.buildAccessStrategy(AccessType.READ_ONLY).lockRegion();
            fail("Did not get READ_ONLY");
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.