Link to home
Start Free TrialLog in
Avatar of srikotesh
srikotesh

asked on

how to disable hibernate query cache

HI Experts,

I Want to disable query cache in my project.

In Hibernate configuration file i made it as
<prop key="hibernate.cache.use_query_cache">false</prop>

is it enough to disable or in query level i have to set as false

 public List<Object> findByHql(final String hqlQuery) {        
        HibernateCallback<Object> hibernateCallback = new HibernateCallback<Object>() {            
            public List<Object> doInHibernate(Session session) {
                Query hibernateQuery = session.createQuery(hqlQuery);
                return hibernateQuery.setCacheable(true).list(); ///here also i need to set cacheable as false or not
            }
        };        
        List<Object> list = (List<Object>) getHibernateTemplate().execute(hibernateCallback);       
    }  

Open in new window


can some one suggest me.
how to test query cache is disabled.

Thanks,
ASKER CERTIFIED SOLUTION
Avatar of Raghu Mutalikdesai
Raghu Mutalikdesai
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of srikotesh
srikotesh

ASKER

THANKS A LOT