Package org.hibernate.cache

Examples of org.hibernate.cache.CacheException


      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


       try {
           if (transactionManager != null) {
               tx = transactionManager.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)
               transactionManager.resume(tx);
       } catch (Exception e) {
           throw new CacheException("Could not resume transaction", e);
       }
   }
View Full Code Here

      Transaction tx = suspend();
      try {
         // We ensure ASYNC semantics (JBCACHE-1175)
         cacheAdapter.withFlags(FlagAdapter.FORCE_ASYNCHRONOUS).put(key, value);
      } catch (Exception e) {
         throw new CacheException(e);
      } finally {
         resume(tx);
      }
   }
View Full Code Here

public class TimestampTypeOverrides extends TypeOverrides {
   @Override
   public void validateInfinispanConfiguration(Configuration configuration) throws CacheException {
      CacheMode cacheMode = configuration.getCacheMode();
      if (cacheMode.equals(CacheMode.INVALIDATION_ASYNC) || cacheMode.equals(CacheMode.INVALIDATION_SYNC)) {
         throw new CacheException("Timestamp cache cannot be configured with invalidation");
      }
      EvictionStrategy strategy = configuration.getEvictionStrategy();
      if (!strategy.equals(EvictionStrategy.NONE)) {
         throw new CacheException("Timestamp cache cannot be configured with eviction");
      }
   }
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

   public Object get(Object key) throws CacheException {
      try {
         return cache.get(key);
      } catch (Exception e) {
         throw new CacheException(e);
      }
   }
View Full Code Here

         return cache.get(key);
      } catch (TimeoutException ignored) {
         // ignore it
         return null;
      } catch (Exception e) {
         throw new CacheException(e);
      }
   }
View Full Code Here

   public Object put(Object key, Object value) throws CacheException {
      try {
         return cache.put(key, value);
      } catch (Exception e) {
         throw new CacheException(e);
      }
   }
View Full Code Here

         return cache.put(key, value);
      } catch (TimeoutException allowed) {
         // ignore it
         return null;
      } catch (Exception e) {
         throw new CacheException(e);
      }
   }
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.