diff --git a/cache/src/main/java/io/jans/service/cache/NativePersistenceCacheProvider.java b/cache/src/main/java/io/jans/service/cache/NativePersistenceCacheProvider.java index b6047f6c241..73d8133e093 100644 --- a/cache/src/main/java/io/jans/service/cache/NativePersistenceCacheProvider.java +++ b/cache/src/main/java/io/jans/service/cache/NativePersistenceCacheProvider.java @@ -201,14 +201,12 @@ private void putImpl(String key, Object object, Date creationDate, int expiratio } } - if (e.getCause() instanceof SearchException) { // on lookup error, try to persist new entry - if (attemptUpdateBeforeInsert) { - try { - entryManager.persist(entity); - return; - } catch (Exception ex) { - log.error("Failed to retry put entry, key: " + originalKey + ", hashedKey: " + key + ", message: " + ex.getMessage(), ex); - } + if (attemptUpdateBeforeInsert) { + try { + entryManager.persist(entity); + return; + } catch (Exception ex) { + log.error("Failed to retry put entry, key: " + originalKey + ", hashedKey: " + key + ", message: " + ex.getMessage(), ex); } }