mirror of https://github.com/apache/openjpa.git
OPENJPA-924: Only cache finder queries without read locks
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@748126 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f5cc8d8b9c
commit
bf16127d19
|
@ -110,6 +110,8 @@ public class FinderCacheImpl
|
|||
*/
|
||||
public FinderQuery<ClassMapping,SelectExecutor,Result>
|
||||
get(ClassMapping mapping, FetchConfiguration fetch) {
|
||||
if (fetch.getReadLockLevel() != 0)
|
||||
return null;
|
||||
boolean ignore = isHinted(fetch, QueryHints.HINT_IGNORE_FINDER);
|
||||
boolean invalidate = isHinted(fetch, QueryHints.HINT_INVALIDATE_FINDER);
|
||||
if (invalidate)
|
||||
|
@ -143,6 +145,8 @@ public class FinderCacheImpl
|
|||
(ClassMapping mapping, SelectExecutor select, FetchConfiguration fetch) {
|
||||
lock();
|
||||
try {
|
||||
if (fetch.getReadLockLevel() != 0)
|
||||
return null;
|
||||
boolean recache = isHinted(fetch, QueryHints.HINT_RECACHE_FINDER);
|
||||
if (isExcluded(mapping)) {
|
||||
return recache ? put(mapping, select) : null;
|
||||
|
|
Loading…
Reference in New Issue