QueryCache can hinder the change in FetchPlan to take effect
------------------------------------------------------------

                 Key: OPENJPA-671
                 URL: https://issues.apache.org/jira/browse/OPENJPA-671
             Project: OpenJPA
          Issue Type: Bug
            Reporter: Pinaki Poddar


>From OpenJPA manual:
"The query cache is enabled by default when the data cache is enabled. ...
When you run a query, OpenJPA assembles a key based on the query properties and 
the parameters used at execution time, and checks for a cached query result. If 
one is found, the object ids in the cached result are looked up, and the 
resultant persistence-capable objects are returned. Otherwise, the query is 
executed against the database, and the object ids loaded by the query are put 
into the cache."

Consider two queries Q1 and Q2 that *only* differ in their fetch plan F1 and 
F2. This implies QueryKey(Q1) = QueryKey(Q2) because QueryKey does not consider 
the fetch plan associated with a Query. 
After Q1 is executed and its results cached, if Q2 is invoked, then OpenJPA 
considers it to be a cache hit and Q2 is not executed at all effectively 
ignoring F2.    

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to