Java Code Examples for org.hibernate.cache.CacheException
The following examples show how to use
org.hibernate.cache.CacheException. These examples are extracted from open source projects.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: J2Cache Source File: ReadWriteJ2CacheEntityRegionAccessStrategy.java License: Apache License 2.0 | 6 votes |
@Override public boolean afterInsert(SharedSessionContractImplementor session, Object key, Object value, Object version) throws CacheException { region().writeLock( key ); try { final AbstractReadWriteJ2CacheAccessStrategy.Lockable item = (AbstractReadWriteJ2CacheAccessStrategy.Lockable) region().get( key ); if ( item == null ) { region().put( key, new AbstractReadWriteJ2CacheAccessStrategy.Item( value, version, region().nextTimestamp() ) ); return true; } else { return false; } } finally { region().writeUnlock( key ); } }
Example 2
Source Project: J2Cache Source File: NonstopAwareCollectionRegionAccessStrategy.java License: Apache License 2.0 | 5 votes |
@Override public void unlockItem(SharedSessionContractImplementor session, Object key, SoftLock lock) throws CacheException { try { this.actualStrategy.unlockItem(session, key, lock); } catch (NonStopCacheException nonStopCacheException) { hibernateNonstopExceptionHandler.handleNonstopCacheException(nonStopCacheException); } }
Example 3
Source Project: mPass Source File: RedissonCacheRegionFactory.java License: Apache License 2.0 | 5 votes |
/** * 准备阶段 */ @Override protected void prepareForUse(SessionFactoryOptions settings, Map properties) throws CacheException { this.context = ApplicationContextHolder.getApplicationContext(); this.defaultConfig = context.getBean(Config.class); super.prepareForUse(settings, properties); }
Example 4
Source Project: J2Cache Source File: NonstopAwareNaturalIdRegionAccessStrategy.java License: Apache License 2.0 | 5 votes |
@Override public void unlockItem(SharedSessionContractImplementor session, Object key, SoftLock lock) throws CacheException { try { this.actualStrategy.unlockItem(session, key, lock); } catch (NonStopCacheException nonStopCacheException) { hibernateNonstopExceptionHandler.handleNonstopCacheException(nonStopCacheException); } }
Example 5
Source Project: J2Cache Source File: NonstopAwareEntityRegionAccessStrategy.java License: Apache License 2.0 | 5 votes |
@Override public void unlockRegion(SoftLock lock) throws CacheException { try { this.actualStrategy.unlockRegion(lock); } catch (NonStopCacheException nonStopCacheException) { hibernateNonstopExceptionHandler.handleNonstopCacheException(nonStopCacheException); } }
Example 6
Source Project: J2Cache Source File: NonstopAwareNaturalIdRegionAccessStrategy.java License: Apache License 2.0 | 5 votes |
@Override public boolean insert(Object key, Object value) throws CacheException { try { return actualStrategy.insert(key, value); } catch (NonStopCacheException nonStopCacheException) { hibernateNonstopExceptionHandler.handleNonstopCacheException(nonStopCacheException); return false; } }
Example 7
Source Project: J2Cache Source File: NonstopAwareNaturalIdRegionAccessStrategy.java License: Apache License 2.0 | 5 votes |
@Override public boolean afterUpdate(Object key, Object value, SoftLock lock) throws CacheException { try { return actualStrategy.afterUpdate(key, value, lock); } catch (NonStopCacheException nonStopCacheException) { hibernateNonstopExceptionHandler.handleNonstopCacheException(nonStopCacheException); return false; } }
Example 8
Source Project: J2Cache Source File: J2HibernateCache.java License: Apache License 2.0 | 5 votes |
@Override public Object get(Object key) throws CacheException { CacheObject cobj = cache.get(region, key.toString()); if (log.isDebugEnabled()) log.debug("get value for j2cache which key:" + key + ",value:" + cobj.getValue()); return cobj.getValue(); }
Example 9
Source Project: J2Cache Source File: NonstopAwareEntityRegionAccessStrategy.java License: Apache License 2.0 | 5 votes |
@Override public void remove(SharedSessionContractImplementor session, Object key) throws CacheException { try { this.actualStrategy.remove(session, key); } catch (NonStopCacheException nonStopCacheException) { hibernateNonstopExceptionHandler.handleNonstopCacheException(nonStopCacheException); } }
Example 10
Source Project: J2Cache Source File: NonstopAwareNaturalIdRegionAccessStrategy.java License: Apache License 2.0 | 5 votes |
@Override public void remove(Object key) throws CacheException { try { actualStrategy.remove(key); } catch (NonStopCacheException nonStopCacheException) { hibernateNonstopExceptionHandler.handleNonstopCacheException(nonStopCacheException); } }
Example 11
Source Project: J2Cache Source File: NonstopAwareNaturalIdRegionAccessStrategy.java License: Apache License 2.0 | 5 votes |
@Override public void removeAll() throws CacheException { try { actualStrategy.removeAll(); } catch (NonStopCacheException nonStopCacheException) { hibernateNonstopExceptionHandler.handleNonstopCacheException(nonStopCacheException); } }
Example 12
Source Project: J2Cache Source File: NonstopAwareNaturalIdRegionAccessStrategy.java License: Apache License 2.0 | 5 votes |
@Override public void unlockRegion(SoftLock lock) throws CacheException { try { actualStrategy.unlockRegion(lock); } catch (NonStopCacheException nonStopCacheException) { hibernateNonstopExceptionHandler.handleNonstopCacheException(nonStopCacheException); } }
Example 13
Source Project: J2Cache Source File: NonstopAwareCollectionRegionAccessStrategy.java License: Apache License 2.0 | 5 votes |
@Override public SoftLock lockItem(SharedSessionContractImplementor session, Object key, Object version) throws CacheException { try { return this.actualStrategy.lockItem(session, key, version); } catch (NonStopCacheException nonStopCacheException) { hibernateNonstopExceptionHandler.handleNonstopCacheException(nonStopCacheException); return null; } }
Example 14
Source Project: J2Cache Source File: NonstopAwareCollectionRegionAccessStrategy.java License: Apache License 2.0 | 5 votes |
@Override public SoftLock lockItem(Object key, Object version) throws CacheException { try { return actualStrategy.lockItem(key, version); } catch (NonStopCacheException nonStopCacheException) { hibernateNonstopExceptionHandler.handleNonstopCacheException(nonStopCacheException); return null; } }
Example 15
Source Project: J2Cache Source File: NonstopAwareCollectionRegionAccessStrategy.java License: Apache License 2.0 | 5 votes |
@Override public boolean putFromLoad(Object key, Object value, long txTimestamp, Object version, boolean minimalPutOverride) throws CacheException { try { return actualStrategy.putFromLoad(key, value, txTimestamp, version, minimalPutOverride); } catch (NonStopCacheException nonStopCacheException) { hibernateNonstopExceptionHandler.handleNonstopCacheException(nonStopCacheException); return false; } }
Example 16
Source Project: J2Cache Source File: NonstopAwareCollectionRegionAccessStrategy.java License: Apache License 2.0 | 5 votes |
@Override public boolean putFromLoad(Object key, Object value, long txTimestamp, Object version) throws CacheException { try { return actualStrategy.putFromLoad(key, value, txTimestamp, version); } catch (NonStopCacheException nonStopCacheException) { hibernateNonstopExceptionHandler.handleNonstopCacheException(nonStopCacheException); return false; } }
Example 17
Source Project: J2Cache Source File: NonstopAwareCollectionRegionAccessStrategy.java License: Apache License 2.0 | 5 votes |
@Override public void remove(Object key) throws CacheException { try { actualStrategy.remove(key); } catch (NonStopCacheException nonStopCacheException) { hibernateNonstopExceptionHandler.handleNonstopCacheException(nonStopCacheException); } }
Example 18
Source Project: J2Cache Source File: NonstopAwareEntityRegionAccessStrategy.java License: Apache License 2.0 | 5 votes |
@Override public boolean putFromLoad(SharedSessionContractImplementor session, Object key, Object value, long txTimestamp, Object version, boolean minimalPutOverride) throws CacheException { try { return this.actualStrategy.putFromLoad(session, key, value, txTimestamp, version, minimalPutOverride); } catch (NonStopCacheException nonStopCacheException) { hibernateNonstopExceptionHandler.handleNonstopCacheException(nonStopCacheException); return false; } }
Example 19
Source Project: J2Cache Source File: NonstopAwareEntityRegionAccessStrategy.java License: Apache License 2.0 | 5 votes |
@Override public void evictAll() throws CacheException { try { this.actualStrategy.evictAll(); } catch (NonStopCacheException nonStopCacheException) { hibernateNonstopExceptionHandler.handleNonstopCacheException(nonStopCacheException); } }
Example 20
Source Project: J2Cache Source File: NonstopAwareCollectionRegionAccessStrategy.java License: Apache License 2.0 | 5 votes |
@Override public void unlockRegion(SoftLock lock) throws CacheException { try { actualStrategy.unlockRegion(lock); } catch (NonStopCacheException nonStopCacheException) { hibernateNonstopExceptionHandler.handleNonstopCacheException(nonStopCacheException); } }
Example 21
Source Project: J2Cache Source File: NonstopAwareEntityRegionAccessStrategy.java License: Apache License 2.0 | 5 votes |
@Override public boolean afterUpdate(Object key, Object value, Object currentVersion, Object previousVersion, SoftLock lock) throws CacheException { try { return actualStrategy.afterUpdate(key, value, currentVersion, previousVersion, lock); } catch (NonStopCacheException nonStopCacheException) { hibernateNonstopExceptionHandler.handleNonstopCacheException(nonStopCacheException); return false; } }
Example 22
Source Project: J2Cache Source File: NonstopAwareEntityRegionAccessStrategy.java License: Apache License 2.0 | 5 votes |
@Override public void evict(Object key) throws CacheException { try { actualStrategy.evict(key); } catch (NonStopCacheException nonStopCacheException) { hibernateNonstopExceptionHandler.handleNonstopCacheException(nonStopCacheException); } }
Example 23
Source Project: J2Cache Source File: NonstopAwareEntityRegionAccessStrategy.java License: Apache License 2.0 | 5 votes |
@Override public void evictAll() throws CacheException { try { actualStrategy.evictAll(); } catch (NonStopCacheException nonStopCacheException) { hibernateNonstopExceptionHandler.handleNonstopCacheException(nonStopCacheException); } }
Example 24
Source Project: J2Cache Source File: NonstopAwareNaturalIdRegionAccessStrategy.java License: Apache License 2.0 | 5 votes |
@Override public boolean afterInsert(SharedSessionContractImplementor session, Object key, Object value) throws CacheException { try { return this.actualStrategy.afterInsert(session, key, value); } catch (NonStopCacheException nonStopCacheException) { hibernateNonstopExceptionHandler.handleNonstopCacheException(nonStopCacheException); return false; } }
Example 25
Source Project: J2Cache Source File: NonstopAwareEntityRegionAccessStrategy.java License: Apache License 2.0 | 5 votes |
@Override public boolean insert(Object key, Object value, Object version) throws CacheException { try { return actualStrategy.insert(key, value, version); } catch (NonStopCacheException nonStopCacheException) { hibernateNonstopExceptionHandler.handleNonstopCacheException(nonStopCacheException); return false; } }
Example 26
Source Project: J2Cache Source File: NonstopAwareEntityRegionAccessStrategy.java License: Apache License 2.0 | 5 votes |
@Override public boolean putFromLoad(Object key, Object value, long txTimestamp, Object version) throws CacheException { try { return actualStrategy.putFromLoad(key, value, txTimestamp, version); } catch (NonStopCacheException nonStopCacheException) { hibernateNonstopExceptionHandler.handleNonstopCacheException(nonStopCacheException); return false; } }
Example 27
Source Project: J2Cache Source File: NonstopAwareEntityRegionAccessStrategy.java License: Apache License 2.0 | 5 votes |
@Override public void remove(Object key) throws CacheException { try { actualStrategy.remove(key); } catch (NonStopCacheException nonStopCacheException) { hibernateNonstopExceptionHandler.handleNonstopCacheException(nonStopCacheException); } }
Example 28
Source Project: J2Cache Source File: TransactionalJ2CacheNaturalIdRegionAccessStrategy.java License: Apache License 2.0 | 5 votes |
@Override public boolean putFromLoad(SharedSessionContractImplementor session, Object key, Object value, long txTimestamp, Object version, boolean minimalPutOverride) throws CacheException { if (minimalPutOverride && cache.get(key) != null) { return false; } cache.put(key, value); return true; }
Example 29
Source Project: J2Cache Source File: J2CacheDataRegion.java License: Apache License 2.0 | 5 votes |
public void destroy() throws CacheException { try { getCache().clear(); } catch (IllegalStateException e) { LOG.debug("This can happen if multiple frameworks both try to shutdown ehcache", e); } }
Example 30
Source Project: J2Cache Source File: AbstractJ2CacheRegionFactory.java License: Apache License 2.0 | 5 votes |
@Override public NaturalIdRegion buildNaturalIdRegion(String regionName, Properties properties, CacheDataDescription metadata) throws CacheException { return new J2CacheNaturalIdRegion( accessStrategyFactory, getCache( regionName ), settings, metadata, properties ); }