Package org.hibernate.cache

Examples of org.hibernate.cache.CacheException


   public CollectionRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException {
      if (AccessType.READ_ONLY.equals(accessType)
            || AccessType.TRANSACTIONAL.equals(accessType))
         return new TransactionalAccess(this);

      throw new CacheException("Unsupported access type [" + accessType.getExternalName() + "]");
   }
View Full Code Here


      try {
         // We ensure ASYNC semantics (JBCACHE-1175) and make sure previous
         // value is not loaded from cache store cos it's not needed.
         timestampsPutCache.put(key, value);
      } catch (Exception e) {
         throw new CacheException(e);
      }
   }
View Full Code Here

       try {
           if (tm != null) {
               tx = tm.suspend();
           }
       } catch (SystemException se) {
           throw new CacheException("Could not suspend transaction", se);
       }
       return tx;
   }
View Full Code Here

   public void resume(Transaction tx) {
       try {
           if (tx != null)
               tm.resume(tx);
       } catch (Exception e) {
           throw new CacheException("Could not resume transaction", e);
       }
   }
View Full Code Here

      case READ_ONLY:
        return new ReadOnlyAccess( this );
      case TRANSACTIONAL:
        return new TransactionalAccess( this );
      default:
        throw new CacheException( "Unsupported access type [" + accessType.getExternalName() + "]" );
    }
  }
View Full Code Here

      try {
         if (transactionManager != null) {
            tx = transactionManager.getTransaction();
         }
      } catch (SystemException se) {
         throw new CacheException("Could not obtain transaction", se);
      }
      return tx == null ? Thread.currentThread() : tx;

   }
View Full Code Here

      return false;
   }

   public void remove(Object key) throws CacheException {
      if (!putValidator.invalidateKey(key)) {
         throw new CacheException("Failed to invalidate pending putFromLoad calls for key " + key + " from region " + region.getName());
      }
      // We update whether or not the region is valid. Other nodes
      // may have already restored the region so they need to
      // be informed of the change.
      writeCache.remove(key);
View Full Code Here

      writeCache.remove(key);
   }

   public void removeAll() throws CacheException {
       if (!putValidator.invalidateRegion()) {
         throw new CacheException("Failed to invalidate pending putFromLoad calls for region " + region.getName());
       }
      cache.clear();
   }
View Full Code Here

      cache.clear();
   }

   public void evict(Object key) throws CacheException {
      if (!putValidator.invalidateKey(key)) {
         throw new CacheException("Failed to invalidate pending putFromLoad calls for key " + key + " from region " + region.getName());
      }
      writeCache.remove(key);
   }
View Full Code Here

      writeCache.remove(key);
   }

   public void evictAll() throws CacheException {
      if (!putValidator.invalidateRegion()) {
         throw new CacheException("Failed to invalidate pending putFromLoad calls for region " + region.getName());
      }
      Transaction tx = region.suspend();
      try {
         region.invalidateRegion(); // Invalidate the local region and then go remote
         Caches.broadcastEvictAll(cache);
View Full Code Here

TOP

Related Classes of org.hibernate.cache.CacheException

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.