ItEr37S07ArquitecturaServidorItEr36S10: Adding second-level cache to hibernate configuration.

ehcache the provider chosen.
This commit is contained in:
Javier Moran Rua 2009-12-06 02:21:12 +01:00
parent 472d208b32
commit 176d0c155d
9 changed files with 51 additions and 1 deletions

View file

@ -89,5 +89,9 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
</dependency>
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
</dependency>
</dependencies>
</project>

View file

@ -0,0 +1,10 @@
<ehcache>
<diskStore path="java.io.tmpdir"/>
<defaultCache
maxElementsInMemory="10000"
eternal="false"
timeToIdleSeconds="120"
timeToLiveSeconds="120"
overflowToDisk="true"
/>
1</ehcache>

View file

@ -9,5 +9,9 @@
<property name="hibernate.format_sql">${hibernate.format_sql}</property>
<property name="hibernate.use_sql_comments">${hibernate.use_sql_comments}</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>
</hibernate-configuration>

View file

@ -19,7 +19,6 @@
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"
p:dataSource-ref="dataSource" p:configLocation="classpath:/navalplanner-business-hibernate.cfg.xml">
<property name="mappingResources">
<list>
<value>

View file

@ -0,0 +1,10 @@
<ehcache>
<diskStore path="java.io.tmpdir"/>
<defaultCache
maxElementsInMemory="10000"
eternal="false"
timeToIdleSeconds="120"
timeToLiveSeconds="120"
overflowToDisk="true"
/>
1</ehcache>

View file

@ -8,5 +8,9 @@
<property name="hibernate.format_sql">true</property>
<property name="hibernate.use_sql_comments">true</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>
</hibernate-configuration>

View file

@ -0,0 +1,10 @@
<ehcache>
<diskStore path="java.io.tmpdir"/>
<defaultCache
maxElementsInMemory="10000"
eternal="false"
timeToIdleSeconds="120"
timeToLiveSeconds="120"
overflowToDisk="true"
/>
1</ehcache>

View file

@ -8,5 +8,9 @@
<property name="hibernate.format_sql">true</property>
<property name="hibernate.use_sql_comments">true</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>
</hibernate-configuration>

View file

@ -513,6 +513,11 @@
<artifactId>timelinez</artifactId>
<version>1.2_1</version>
</dependency>
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
<version>1.6.2</version>
</dependency>
</dependencies>
</dependencyManagement>