java - how to use ehcache in spring mvc with hibernate -
I'm new to Spring-MVC and want to integrate the eHatch as a second level cache in Hibernate. I followed this tutorial now in my Hibernate.XML the entries are as follows:
& Lt; Property Name = "hibernate.cache.use_second_level_cache" value = "true" /> & Lt; Property Name = "hibernate.cache.use_query_cache" & gt; True & lt; / Property & gt; & Lt; Property Name = "hibernate.cache.provider_configuration_file_resource_path" & gt; Ehcache.xml & lt; / Property & gt; & Lt; Property Name = "hibernate.generate_statistics" & gt; True & lt; / Property & gt; The entries in ehcache.xml are as follows:
& lt; Ehcache xmlns: xsi = "http://www.w3.org/2001/ XMLSchema-Example" xsi: noNamespaceSchema location = "http://ehcache.org/ehcache.xsd" & gt; & Lt; DiskStore Path = "java.io.tmpdir" /> & Lt ;! MaxCollection = "10000" Overflow Toddsisk = "True" Discourseant = "True" TimololveWaysconds = "300" Figures = "True" Copy Onwright = "True" / - & - DefaultCache Infinity = "False" Maximum Elements = "1000" Maximum Elements OnDisk = "10000" Gt; & Lt; Cache name = "com.payupaisa.cms.model.Event" maxElementsInmemory = "100000" eternal = "true" overflow toricic = "false" memorystore aviation policy = "Lufu" data = "correct" timeOutsOseconds = "3600" /> ; & Lt; / Ehcache & gt; We are following the MVC model and I defined the annotation in the model
@Entity @Cache (use = CacheConcurrencyStrategy.READ_ONLY, region = "department ") The problem now is how to start using this cache in the service cache. I have not created a hybrid. Java in my project We are applying web based spring-hibernate MVC, now how I am starting, I can not find
< P> It shows you an example to integrate spring + hibernate + eachchatch.
Comments
Post a Comment