When using Hibernate 2nd level cache and query cache and not specifying anything inside ehcache.xml, what is the default caching time?
When using Hibernate 2nd level cache and query cache and not specifying anything inside
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Taken from the documentation on Cache Configuration:
Note that EHCache uses a timeToLive, not an expire time and the default is 0 if not specified.
Update: While the above about defaults when configuring a cache is true, it appears that these defaults don’t apply if you don’t provide any
ehcache.xml. So I dug a bit further and I think that EHCache may actually always use adefaultCachein that case – including for the StandardQueryCache – and this defaultCache has a timeToLive of 2 minutes:I can’t confirm this right now but this is what I would do: