[
https://issues.apache.org/jira/browse/OPENJPA-1511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12840820#action_12840820
]
Ravi P Palacherla commented on OPENJPA-1511:
--------------------------------------------
Adding the Dev mailing list conversation for historical reasons.
Kevin Sutter's comment on this issue:
--------------------------------------------------
" We should only update the L2 cache upon a commit or a re-read from the
database (going to and from the database). Expecting dangling L1 entities to
automatically populate the L2 cache is beyond the scope of the cache capability
(IMHO).
So, what if we modify the scenario and use Ravi's suggestion of evicting both
the L1 and L2 items. Then, when accessing the query results, we should have to
go against the database and get the L2 cache re-populated. I'm assuming this
works correctly...
Kevin
"
> Executing a cached query doesn't properly cache results after DataCache
> eviction
> --------------------------------------------------------------------------------
>
> Key: OPENJPA-1511
> URL: https://issues.apache.org/jira/browse/OPENJPA-1511
> Project: OpenJPA
> Issue Type: Bug
> Affects Versions: 2.0.0-beta
> Reporter: Rick Curtis
> Assignee: Ravi P Palacherla
> Attachments: TestCache.java
>
>
> When doing some testing I found that the QueryCache sometimes doesn't put
> results into the DataCache.
> I haven't had time to debug the problem, but I'm opening this JIRA so I can
> attach the test case I've created.
> The test scenario is as follows:
> String query = "Select t FROM Item t where 1=1 ORDER BY t.id";
> items = em.createQuery(query,Item.class).getResultList();
> assertTrue(storeCache.contains(Item.class, items.get(0).getId()));
> // Make sure that all of the results are in the DataCache.
> for(Item o : items){
> assertTrue(storeCache.contains(Item.class, o.getId()));
> }
> storeCache.evict(Item.class,items.get(0).getId());
> // Evict one result
> assertFalse(storeCache.contains(Item.class,items.get(0).getId()));
>
> // Executing the same query should re-populate the datacache
> items = em.createQuery(query,Item.class).getResultList();
> assertTrue(storeCache.contains(Item.class, items.get(0).getId())); // fails
> here
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.