Skip to content

Commit

Permalink
Configuration of CACHE_QUERY_FORCE_DEFERRED_LOCKS - fix (#1925)
Browse files Browse the repository at this point in the history
This fix is limited on 2.7 branch. In master, 4.0, 3.0 is setQueryCacheForceDeferredLocks... placed before possible return.
This move setQueryCacheForceDeferredLocks... before possible return
  • Loading branch information
rfelcman authored Aug 18, 2023
1 parent a70ed7c commit 84a4e1e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1456,15 +1456,15 @@ protected void updateDescriptorCacheSettings(Map m, ClassLoader loader) {
if ((queryCache != null) && queryCache.equalsIgnoreCase("true")) {
session.getProject().setDefaultQueryResultsCachePolicy(new QueryResultsCachePolicy());
}
String queryCacheForceDeferredLocks = getConfigPropertyAsStringLogDebug(PersistenceUnitProperties.CACHE_QUERY_FORCE_DEFERRED_LOCKS, m, session);
session.getProject().setQueryCacheForceDeferredLocks("true".equalsIgnoreCase(queryCacheForceDeferredLocks));

Map typeMap = PropertiesHandler.getPrefixValuesLogDebug(PersistenceUnitProperties.CACHE_TYPE_, m, session);
Map sizeMap = PropertiesHandler.getPrefixValuesLogDebug(PersistenceUnitProperties.CACHE_SIZE_, m, session);
Map sharedMap = PropertiesHandler.getPrefixValuesLogDebug(PersistenceUnitProperties.CACHE_SHARED_, m, session);
if(typeMap.isEmpty() && sizeMap.isEmpty() && sharedMap.isEmpty()) {
return;
}
String queryCacheForceDeferredLocks = getConfigPropertyAsStringLogDebug(PersistenceUnitProperties.CACHE_QUERY_FORCE_DEFERRED_LOCKS, m, session);
session.getProject().setQueryCacheForceDeferredLocks("true".equalsIgnoreCase(queryCacheForceDeferredLocks));

String defaultTypeName = (String)typeMap.remove(PersistenceUnitProperties.DEFAULT);
if (defaultTypeName != null) {
Expand Down

0 comments on commit 84a4e1e

Please sign in to comment.