Package org.hibernate.cache

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


        }
        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();
           
            CollectionRegion localCollectionRegion = rf.buildCollectionRegion(REGION_NAME, cfg.getProperties(), null);
            setCollectionAccessStrategy(localCollectionRegion.buildAccessStrategy(getAccessType()));
        }
    }

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

      final AccessType accessType = AccessType.parse( model.getCacheConcurrencyStrategy() );
      CollectionRegionAccessStrategy accessStrategy = null;
      if ( accessType != null && settings.isSecondLevelCacheEnabled() ) {
        log.trace( "Building cache for collection data [" + model.getRole() + "]" );
        CollectionRegion collectionRegion = settings.getRegionFactory().buildCollectionRegion( cacheRegionName, properties, CacheDataDescriptionImpl.decode( model ) );
        accessStrategy = collectionRegion.buildAccessStrategy( accessType );
        entityAccessStrategies.put( cacheRegionName, accessStrategy );
        allCacheRegions.put( cacheRegionName, collectionRegion );
      }
      CollectionPersister persister = PersisterFactory.createCollectionPersister( cfg, model, accessStrategy, this) ;
      collectionPersisters.put( model.getRole(), persister.getCollectionMetadata() );
View Full Code Here

   }

   @Override
   protected void supportedAccessTypeTest(RegionFactory regionFactory, Properties properties) {
      CollectionRegion region = regionFactory.buildCollectionRegion("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) {
      CollectionRegion region = regionFactory.buildCollectionRegion("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();
          
           CollectionRegion localCollectionRegion = rf.buildCollectionRegion(REGION_NAME, cfg.getProperties(), null);
           setCollectionAccessStrategy(localCollectionRegion.buildAccessStrategy(getAccessType()));
       }
   }

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

           
            // Sleep a bit to avoid concurrent FLUSH problem
            avoidConcurrentFlush();
           
            CollectionRegion localCollectionRegion = rf.buildCollectionRegion(REGION_NAME, cfg.getProperties(), null);
            setCollectionAccessStrategy(localCollectionRegion.buildAccessStrategy(getAccessType()));
        }
    }

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

    @Override
    protected void supportedAccessTypeTest(RegionFactory regionFactory, Properties properties) {
       
        CollectionRegion region = regionFactory.buildCollectionRegion("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.