Package org.hibernate.cache

Examples of org.hibernate.cache.CacheException


    public static void removeAll(Cache cache, Fqn region, Option option) throws CacheException {
        try {
            setInvocationOption(cache, option);
            cache.removeNode(region);
        } catch (Exception e) {
            throw new CacheException(e);
        }
    }
View Full Code Here


    public static void removeNode(Cache cache, Fqn region, Object key, Option option) throws CacheException {
        try {
            setInvocationOption(cache, option);
            cache.removeNode(new Fqn(region, key));
        } catch (Exception e) {
            throw new CacheException(e);
        }
    }
View Full Code Here

            if (resident)
                added.setResident(true);
            return added;
        }
        catch (Exception e) {
            throw new CacheException(e);
        }
    }
View Full Code Here

            return optimistic ? new OptimisticTransactionalAccess(this) : new TransactionalAccess(this);
        }

        // todo : add support for READ_WRITE ( + NONSTRICT_READ_WRITE ??? )

        throw new CacheException("unsupported access type [" + accessType.getName() + "]");
    }
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.
      cacheAdapter.remove(key);
View Full Code Here

      cacheAdapter.remove(key);
   }

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

      cacheAdapter.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());
      }     
      cacheAdapter.remove(key);
   }
View Full Code Here

      cacheAdapter.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 {
         CacheHelper.sendEvictAllNotification(cacheAdapter, region.getAddress());
      } finally {
View Full Code Here

      if (AccessType.READ_ONLY.equals(accessType)) {
         return new ReadOnlyAccess(this);
      } else if (AccessType.TRANSACTIONAL.equals(accessType)) {
         return new TransactionalAccess(this);
      }
      throw new CacheException("Unsupported access type [" + accessType.getName() + "]");
   }
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.