hibernate - Grails not using query cache in view -


i've found odd issue regarding query cache in grails , it's called. i've tested several times , got same result.

problem: bellow view\gsp code hits database every time though have cache:true on.

 <g:select name="foo.thing.id" in="${thing.findall([cache:true])}" value="${foo.thing?.id}" /> 

workaround: pushing query call controller respects cache:true argument , stops hitting database on every page load.

controller:

def dostuff = {   def things = thing.findall([cache:true]);   return ['things':things] } 

view:

<g:select name="foo.thing.id" in="${things}" value="${foo.thing?.id}" /> 

i'm using grails 1.3.7 following config....

hibernate {     cache.use_second_level_cache=true     cache.use_query_cache=true     cache.provider_class='org.hibernate.cache.ehcacheprovider' } 

has else seen or can describe me why work differently?

i'm not sure why doesn't work, grails, not php - don't database access in view.


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -