Author: tchemit Date: 2013-12-01 22:17:47 +0100 (Sun, 01 Dec 2013) New Revision: 1417 Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1417 Log: do not use hibernate second level cache Added: trunk/tutti-persistence/src/main/resources/ehcache.xml Modified: trunk/tutti-persistence/src/main/resources/applicationContext-service-tutti.xml trunk/tutti-persistence/src/main/resources/tutti-db-conf.properties Modified: trunk/tutti-persistence/src/main/resources/applicationContext-service-tutti.xml =================================================================== --- trunk/tutti-persistence/src/main/resources/applicationContext-service-tutti.xml 2013-12-01 21:15:43 UTC (rev 1416) +++ trunk/tutti-persistence/src/main/resources/applicationContext-service-tutti.xml 2013-12-01 21:17:47 UTC (rev 1417) @@ -40,127 +40,106 @@ class="fr.ifremer.tutti.persistence.service.TuttiEnumerationFile"/> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> - <!-- Caches management for tutti (not defined in adagio-core/ehcache.xml) --> + <!-- Caches management for tutti (not defined in adagio-core files) --> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- Session caches : --> - <bean id="tuttiAbstractCache" abstract="true" class="org.springframework.cache.ehcache.EhCacheFactoryBean"> - <property name="cacheManager" ref="ehcache"/> - <property name="maxElementsInMemory" value="5000"/> - <property name="eternal" value="false"/> - <property name="timeToLive" value="300"/> - <property name="timeToIdle" value="300"/> - <property name="overflowToDisk" value="false"/> - <property name="diskPersistent" value="false"/> - <property name="diskExpiryThreadIntervalSeconds" value="300"/> - </bean> - - <!-- Eternal caches : --> - <bean id="tuttiAbstractEternalCache" abstract="true" parent="tuttiAbstractCache"> - <property name="eternal" value="true"/> - <property name="overflowToDisk" value="true"/> - <property name="maxElementsOnDisk" value="5000"/> - <property name="diskPersistent" value="true"/> - <!-- removed inherited properties --> - <property name="timeToLive" value="0"/> - <property name="timeToIdle" value="0"/> - <property name="diskExpiryThreadIntervalSeconds" value="0"/> - </bean> - - <bean id="tuttiProgramsCache" parent="tuttiAbstractEternalCache"> + + <bean id="tuttiProgramsCache" parent="abstractEternalCache"> <property name="cacheName" value="programs" /> <property name="maxElementsInMemory" value="1"/> <property name="maxElementsOnDisk" value="1"/> </bean> - <bean id="tuttiProgramZonesCache" parent="tuttiAbstractEternalCache"> + <bean id="tuttiProgramZonesCache" parent="abstractEternalCache"> <property name="cacheName" value="programZones" /> <property name="maxElementsInMemory" value="1"/> <property name="maxElementsOnDisk" value="1"/> </bean> - <bean id="countriesCache" parent="tuttiAbstractEternalCache"> + <bean id="countriesCache" parent="abstractEternalCache"> <property name="cacheName" value="countries" /> <property name="maxElementsInMemory" value="1"/> <property name="maxElementsOnDisk" value="1"/> </bean> - <bean id="harboursCache" parent="tuttiAbstractEternalCache"> + <bean id="harboursCache" parent="abstractEternalCache"> <property name="cacheName" value="harbours" /> <property name="maxElementsInMemory" value="1"/> <property name="maxElementsOnDisk" value="1"/> </bean> - <bean id="tuttiPmfmsCache" parent="tuttiAbstractEternalCache"> + <bean id="tuttiPmfmsCache" parent="abstractEternalCache"> <property name="cacheName" value="pmfms" /> </bean> - <bean id="tuttiPmfmsWithProtectedCache" parent="tuttiAbstractEternalCache"> + + <bean id="tuttiPmfmsWithProtectedCache" parent="abstractEternalCache"> <property name="cacheName" value="pmfmsWithProtected" /> </bean> - <bean id="tuttiPmfmByIdCache" parent="tuttiAbstractEternalCache"> + + <bean id="tuttiPmfmByIdCache" parent="abstractEternalCache"> <property name="cacheName" value="pmfmById" /> </bean> - <bean id="tuttiObjectTypeCache" parent="tuttiAbstractEternalCache"> + <bean id="tuttiObjectTypeCache" parent="abstractEternalCache"> <property name="cacheName" value="objectTypes" /> </bean> - <bean id="tuttiObjectTypeByCodeCache" parent="tuttiAbstractEternalCache"> + <bean id="tuttiObjectTypeByCodeCache" parent="abstractEternalCache"> <property name="cacheName" value="objectTypeByCode" /> </bean> - <bean id="tuttiFishingVesselsCache" parent="tuttiAbstractEternalCache"> + <bean id="tuttiFishingVesselsCache" parent="abstractEternalCache"> <property name="cacheName" value="fishingVessels" /> <property name="maxElementsInMemory" value="1"/> <property name="maxElementsOnDisk" value="1"/> </bean> - <bean id="tuttiFishingVesselByCodeCache" parent="tuttiAbstractEternalCache"> + + <bean id="tuttiFishingVesselByCodeCache" parent="abstractEternalCache"> <property name="cacheName" value="vesselByCode" /> <property name="maxElementsInMemory" value="40000"/> <property name="maxElementsOnDisk" value="40000"/> </bean> - <bean id="tuttiSpeciesCache" parent="tuttiAbstractEternalCache"> + <bean id="tuttiSpeciesCache" parent="abstractEternalCache"> <property name="cacheName" value="species" /> <property name="maxElementsInMemory" value="1"/> <property name="maxElementsOnDisk" value="1"/> </bean> - <bean id="tuttiReferentSpeciesCache" parent="tuttiAbstractEternalCache"> + <bean id="tuttiReferentSpeciesCache" parent="abstractEternalCache"> <property name="cacheName" value="referentSpecies" /> <property name="maxElementsInMemory" value="1"/> <property name="maxElementsOnDisk" value="1"/> </bean> - <bean id="tuttiReferentSpeciesByIdCache" parent="tuttiAbstractEternalCache"> + + <bean id="tuttiReferentSpeciesByIdCache" parent="abstractEternalCache"> <property name="cacheName" value="referentSpeciesById" /> <property name="maxElementsInMemory" value="20000"/> <property name="maxElementsOnDisk" value="20000"/> </bean> - <bean id="tuttiReferentSpeciesByIdVenacularCache" parent="tuttiAbstractEternalCache"> + + <bean id="tuttiReferentSpeciesByIdVenacularCache" parent="abstractEternalCache"> <property name="cacheName" value="referentSpeciesByIdVernacular" /> <property name="maxElementsInMemory" value="20000"/> <property name="maxElementsOnDisk" value="20000"/> </bean> - <bean id="tuttiGearsCache" parent="tuttiAbstractEternalCache"> + <bean id="tuttiGearsCache" parent="abstractEternalCache"> <property name="cacheName" value="gears" /> <property name="maxElementsInMemory" value="1"/> <property name="maxElementsOnDisk" value="1"/> </bean> - <bean id="tuttiPersonsCache" parent="tuttiAbstractEternalCache"> + <bean id="tuttiPersonsCache" parent="abstractEternalCache"> <property name="cacheName" value="persons" /> <property name="maxElementsInMemory" value="1"/> <property name="maxElementsOnDisk" value="1"/> </bean> - <bean id="tuttiPersonByIdCache" parent="tuttiAbstractEternalCache"> + <bean id="tuttiPersonByIdCache" parent="abstractEternalCache"> <property name="cacheName" value="personById" /> <property name="maxElementsInMemory" value="1000"/> <property name="maxElementsOnDisk" value="1000"/> </bean> - - <!-- Example to use to create a new cache area : - <bean id="tuttiOtherCache" parent="tuttiPersistenceDefaultCache"> - </bean> --> - + </beans> \ No newline at end of file Added: trunk/tutti-persistence/src/main/resources/ehcache.xml =================================================================== --- trunk/tutti-persistence/src/main/resources/ehcache.xml (rev 0) +++ trunk/tutti-persistence/src/main/resources/ehcache.xml 2013-12-01 21:17:47 UTC (rev 1417) @@ -0,0 +1,80 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + #%L + Tutti :: Persistence + $Id$ + $HeadURL$ + %% + Copyright (C) 2012 - 2013 Ifremer + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public + License along with this program. If not, see + <http://www.gnu.org/licenses/gpl-3.0.html>. + #L% + --> + +<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="http://ehcache.org/ehcache.xsd" + updateCheck="false"> + + <!-- Sets the path to the directory where cache .data files are created. + + If the path is a Java System Property it is replaced by + its value in the running VM. + + The following properties are translated: + user.home - User's home directory + user.dir - User's current working directory + java.io.tmpdir - Default temp file path --> + <!--<diskStore path="java.io.tmpdir"/>--> + + <!--Default Cache configuration. These will applied to caches programmatically created through + the CacheManager. + + The following attributes are required for defaultCache: + + maxInMemory - Sets the maximum number of objects that will be created in memory + eternal - Sets whether elements are eternal. If eternal, timeouts are ignored and the element + is never expired. + timeToIdleSeconds - Sets the time to idle for an element before it expires. + i.e. The maximum amount of time between accesses before an element expires + Is only used if the element is not eternal. + Optional attribute. A value of 0 means that an Element can idle for infinity + timeToLiveSeconds - Sets the time to live for an element before it expires. + i.e. The maximum time between creation time and when an element expires. + Is only used if the element is not eternal. + overflowToDisk - Sets whether elements can overflow to disk when the in-memory cache + has reached the maxInMemory limit. + + --> + <defaultCache + maxElementsInMemory="10000" + eternal="false" + timeToIdleSeconds="120" + timeToLiveSeconds="120" + overflowToDisk="true"/> + + <cache name="org.hibernate.cache.UpdateTimestampsCache" + eternal="false" + maxElementsInMemory="10000" + timeToIdleSeconds="300" + timeToLiveSeconds="300" + overflowToDisk="false"/> + <cache name="org.hibernate.cache.StandardQueryCache" + eternal="false" + maxElementsInMemory="10000" + timeToIdleSeconds="300" + timeToLiveSeconds="300" + overflowToDisk="false"/> + +</ehcache> Property changes on: trunk/tutti-persistence/src/main/resources/ehcache.xml ___________________________________________________________________ Added: svn:mime-type + text/xml Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Modified: trunk/tutti-persistence/src/main/resources/tutti-db-conf.properties =================================================================== --- trunk/tutti-persistence/src/main/resources/tutti-db-conf.properties 2013-12-01 21:15:43 UTC (rev 1416) +++ trunk/tutti-persistence/src/main/resources/tutti-db-conf.properties 2013-12-01 21:17:47 UTC (rev 1417) @@ -43,6 +43,7 @@ hibernate.show_sql=${tutti.persistence.hibernate.showSql} hibernate.format_sql=${tutti.persistence.hibernate.formatSql} hibernate.use_sql_comments=${tutti.persistence.hibernate.useSqlComment} +hibernate.use_second_level_cache=false hibernate.generate_statistics=false hibernate.query.substitutions=true 1, false 0 hibernate.hbm2ddl.auto=none
participants (1)
-
tchemit@users.forge.codelutin.com