OPENJPA-703: Ignore prepared query if query is locking. Merged from trunk revision 935231

git-svn-id: https://svn.apache.org/repos/asf/openjpa/branches/2.0.x@935232 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Pinaki Poddar 2010-04-17 19:30:56 +00:00
parent 9c3e403308
commit 7312e27fde
1 changed files with 5 additions and 1 deletions

View File

@ -508,8 +508,12 @@ public class QueryImpl<X> implements OpenJPAQuerySPI<X>, Serializable {
return false;
}
FetchConfiguration fetch = _query.getFetchConfiguration();
if (fetch.getReadLockLevel() != 0)
if (fetch.getReadLockLevel() != 0) {
if (cache.get(_id) != null) {
ignorePreparedQuery();
}
return false;
}
Boolean registered = cache.register(_id, _query, fetch);
boolean alreadyCached = (registered == null);
String lang = _query.getLanguage();