ItEr37S07ArquitecturaServidorItEr36S10: Adding second-level cache to hibernate configuration.
ehcache the provider chosen.
This commit is contained in:
parent
472d208b32
commit
176d0c155d
9 changed files with 51 additions and 1 deletions
|
|
@ -89,5 +89,9 @@
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
<artifactId>slf4j-simple</artifactId>
|
<artifactId>slf4j-simple</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>net.sf.ehcache</groupId>
|
||||||
|
<artifactId>ehcache</artifactId>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|
|
||||||
10
navalplanner-business/src/main/resources/ehcache.xml
Normal file
10
navalplanner-business/src/main/resources/ehcache.xml
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
<ehcache>
|
||||||
|
<diskStore path="java.io.tmpdir"/>
|
||||||
|
<defaultCache
|
||||||
|
maxElementsInMemory="10000"
|
||||||
|
eternal="false"
|
||||||
|
timeToIdleSeconds="120"
|
||||||
|
timeToLiveSeconds="120"
|
||||||
|
overflowToDisk="true"
|
||||||
|
/>
|
||||||
|
1</ehcache>
|
||||||
|
|
@ -9,5 +9,9 @@
|
||||||
<property name="hibernate.format_sql">${hibernate.format_sql}</property>
|
<property name="hibernate.format_sql">${hibernate.format_sql}</property>
|
||||||
<property name="hibernate.use_sql_comments">${hibernate.use_sql_comments}</property>
|
<property name="hibernate.use_sql_comments">${hibernate.use_sql_comments}</property>
|
||||||
<property name="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</property>
|
<property name="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</property>
|
||||||
|
<property name="hibernate.cache.provider_class">net.sf.ehcache.hibernate.EhCacheProvider</property>
|
||||||
|
<property name="hibernate.cache.use_second_level_cache">true</property>
|
||||||
|
<property name="hibernate.cache.use_query_cache">true</property>
|
||||||
|
<property name="hibernate.cache.provider_configuration_file_resource_path">classpath:ehcache.xml</property>
|
||||||
</session-factory>
|
</session-factory>
|
||||||
</hibernate-configuration>
|
</hibernate-configuration>
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,6 @@
|
||||||
<bean id="sessionFactory"
|
<bean id="sessionFactory"
|
||||||
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"
|
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"
|
||||||
p:dataSource-ref="dataSource" p:configLocation="classpath:/navalplanner-business-hibernate.cfg.xml">
|
p:dataSource-ref="dataSource" p:configLocation="classpath:/navalplanner-business-hibernate.cfg.xml">
|
||||||
|
|
||||||
<property name="mappingResources">
|
<property name="mappingResources">
|
||||||
<list>
|
<list>
|
||||||
<value>
|
<value>
|
||||||
|
|
|
||||||
10
navalplanner-business/src/test/resources/ehcache.xml
Normal file
10
navalplanner-business/src/test/resources/ehcache.xml
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
<ehcache>
|
||||||
|
<diskStore path="java.io.tmpdir"/>
|
||||||
|
<defaultCache
|
||||||
|
maxElementsInMemory="10000"
|
||||||
|
eternal="false"
|
||||||
|
timeToIdleSeconds="120"
|
||||||
|
timeToLiveSeconds="120"
|
||||||
|
overflowToDisk="true"
|
||||||
|
/>
|
||||||
|
1</ehcache>
|
||||||
|
|
@ -8,5 +8,9 @@
|
||||||
<property name="hibernate.format_sql">true</property>
|
<property name="hibernate.format_sql">true</property>
|
||||||
<property name="hibernate.use_sql_comments">true</property>
|
<property name="hibernate.use_sql_comments">true</property>
|
||||||
<property name="hibernate.hbm2ddl.auto">create</property>
|
<property name="hibernate.hbm2ddl.auto">create</property>
|
||||||
|
<property name="hibernate.cache.provider_class">net.sf.ehcache.hibernate.EhCacheProvider</property>
|
||||||
|
<property name="hibernate.cache.use_second_level_cache">true</property>
|
||||||
|
<property name="hibernate.cache.use_query_cache">true</property>
|
||||||
|
<property name="hibernate.cache.provider_configuration_file_resource_path">classpath:ehcache.xml</property>
|
||||||
</session-factory>
|
</session-factory>
|
||||||
</hibernate-configuration>
|
</hibernate-configuration>
|
||||||
|
|
|
||||||
10
navalplanner-webapp/src/test/resources/ehcache.xml
Normal file
10
navalplanner-webapp/src/test/resources/ehcache.xml
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
<ehcache>
|
||||||
|
<diskStore path="java.io.tmpdir"/>
|
||||||
|
<defaultCache
|
||||||
|
maxElementsInMemory="10000"
|
||||||
|
eternal="false"
|
||||||
|
timeToIdleSeconds="120"
|
||||||
|
timeToLiveSeconds="120"
|
||||||
|
overflowToDisk="true"
|
||||||
|
/>
|
||||||
|
1</ehcache>
|
||||||
|
|
@ -8,5 +8,9 @@
|
||||||
<property name="hibernate.format_sql">true</property>
|
<property name="hibernate.format_sql">true</property>
|
||||||
<property name="hibernate.use_sql_comments">true</property>
|
<property name="hibernate.use_sql_comments">true</property>
|
||||||
<property name="hibernate.hbm2ddl.auto">create</property>
|
<property name="hibernate.hbm2ddl.auto">create</property>
|
||||||
|
<property name="hibernate.cache.provider_class">net.sf.ehcache.hibernate.EhCacheProvider</property>
|
||||||
|
<property name="hibernate.cache.use_second_level_cache">true</property>
|
||||||
|
<property name="hibernate.cache.use_query_cache">true</property>
|
||||||
|
<property name="hibernate.cache.provider_configuration_file_resource_path">classpath:ehcache.xml</property>
|
||||||
</session-factory>
|
</session-factory>
|
||||||
</hibernate-configuration>
|
</hibernate-configuration>
|
||||||
|
|
|
||||||
5
pom.xml
5
pom.xml
|
|
@ -513,6 +513,11 @@
|
||||||
<artifactId>timelinez</artifactId>
|
<artifactId>timelinez</artifactId>
|
||||||
<version>1.2_1</version>
|
<version>1.2_1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>net.sf.ehcache</groupId>
|
||||||
|
<artifactId>ehcache</artifactId>
|
||||||
|
<version>1.6.2</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</dependencyManagement>
|
</dependencyManagement>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue