[HHH-5431] (Infinispan's CacheAdapterImpl.putAllowingTimeout not using silent flag) Added fail silently flag.
git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@20100 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
parent
dc6fe99c37
commit
2e5a338dd6
|
@ -82,7 +82,7 @@ public class CacheAdapterImpl implements CacheAdapter {
|
|||
|
||||
public Object getAllowingTimeout(Object key) throws CacheException {
|
||||
try {
|
||||
return cache.get(key);
|
||||
return getFailSilentCache().get(key);
|
||||
} catch (TimeoutException ignored) {
|
||||
// ignore it
|
||||
return null;
|
||||
|
@ -101,7 +101,7 @@ public class CacheAdapterImpl implements CacheAdapter {
|
|||
|
||||
public Object putAllowingTimeout(Object key, Object value) throws CacheException {
|
||||
try {
|
||||
return cache.put(key, value);
|
||||
return getFailSilentCache().put(key, value);
|
||||
} catch (TimeoutException allowed) {
|
||||
// ignore it
|
||||
return null;
|
||||
|
@ -202,4 +202,7 @@ public class CacheAdapterImpl implements CacheAdapter {
|
|||
return cache.getConfiguration();
|
||||
}
|
||||
|
||||
private Cache getFailSilentCache() {
|
||||
return cache.getAdvancedCache().withFlags(Flag.FAIL_SILENTLY);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue