On Fri, May 28, 2010 at 4:28 PM, Andrus Adamchik <and...@objectstyle.org> wrote: > > On May 28, 2010, at 9:20 AM, Gary Jarrel wrote: > >> I would expect that the the second query q2 would not execute any SQL >> however the QueryLogger logs the second select statement. > > The second query has no cache group or cache strategy in your example, so it > is not using caching.
Ahh I didn't realize that I had to specify the cache group for the second query as well... I thought given that I was executing a query with the same parameters it would have picked up the fact that one is already cached without having to specify which cache group to look into. Probably how I read the docs. So does this mean that for query caching to work I have to specify the cache group and cache strategy and that the modeler settings only apply to Object cache? > >> Also the assert on the query cache size fails the it appears the size >> is zero rather than 1 as I would have expected. > > is domain.getQueryCache().size() also returning zero? > No it seems that domain.getQueryCache().size() is returning 1 assertEquals(1, ((DataContext) getDataContext()).getParentDataDomain().getQueryCache().size()); assertEquals(1, ((DataContext) getDataContext()).getQueryCache().size()); I've put these 2 lines into the test case and it fails on the second line. Gary