use of net.sf.ehcache.constructs.nonstop.NonStopCacheException in project hibernate-orm by hibernate.
the class EhcacheGeneralDataRegion method put.
@Override
public void put(SharedSessionContractImplementor session, Object key, Object value) throws CacheException {
LOG.debugf("key: %s value: %s", key, value);
try {
final Element element = new Element(key, value);
getCache().put(element);
} catch (IllegalArgumentException e) {
throw new CacheException(e);
} catch (IllegalStateException e) {
throw new CacheException(e);
} catch (net.sf.ehcache.CacheException e) {
if (e instanceof NonStopCacheException) {
HibernateNonstopCacheExceptionHandler.getInstance().handleNonstopCacheException((NonStopCacheException) e);
} else {
throw new CacheException(e);
}
}
}
use of net.sf.ehcache.constructs.nonstop.NonStopCacheException in project hibernate-orm by hibernate.
the class EhcacheTransactionalDataRegion method put.
/**
* Map the given value to the given key, replacing any existing mapping for this key
*
* @param key The cache key
* @param value The data to cache
*
* @throws CacheException Indicates a problem accessing the cache
*/
public final void put(Object key, Object value) throws CacheException {
try {
final Element element = new Element(key, value);
getCache().put(element);
} catch (IllegalArgumentException e) {
throw new CacheException(e);
} catch (IllegalStateException e) {
throw new CacheException(e);
} catch (net.sf.ehcache.CacheException e) {
if (e instanceof NonStopCacheException) {
HibernateNonstopCacheExceptionHandler.getInstance().handleNonstopCacheException((NonStopCacheException) e);
} else {
throw new CacheException(e);
}
}
}
Aggregations