mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
EHCache upgrade.
- some minor API changes - Spring and Hibernate share same CacheManagerFactory now. This allows overridable config - Moved EHCache config files down into config/alfresco git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2521 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -15,10 +15,16 @@
|
||||
|
||||
<bean name="transactionalEHCacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean" >
|
||||
<property name="configLocation">
|
||||
<value>classpath:ehcache-transactional.xml</value>
|
||||
<value>classpath:alfresco/ehcache-transactional.xml</value>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!-- ============================================ -->
|
||||
<!-- EH Cache Manager to produce shared EH Caches -->
|
||||
<!-- ============================================ -->
|
||||
|
||||
<bean name="internalEHCacheManager" class="org.alfresco.repo.cache.InternalEhCacheManagerFactoryBean" />
|
||||
|
||||
<!-- ================ -->
|
||||
<!-- Null permissions -->
|
||||
<!-- ================ -->
|
||||
@@ -28,8 +34,10 @@
|
||||
<bean name="nullPermissionSharedCache" class="org.alfresco.repo.cache.EhCacheAdapter">
|
||||
<property name="cache">
|
||||
<bean class="org.springframework.cache.ehcache.EhCacheFactoryBean" >
|
||||
<property name="cacheManager">
|
||||
<ref bean="internalEHCacheManager" />
|
||||
</property>
|
||||
<property name="cacheName">
|
||||
<!-- The name of the ehCache area -->
|
||||
<value>nullPermissionCache</value>
|
||||
</property>
|
||||
<property name="maxElementsInMemory">
|
||||
@@ -51,7 +59,6 @@
|
||||
<property name="cacheManager" >
|
||||
<ref bean="transactionalEHCacheManager" />
|
||||
</property>
|
||||
<!-- Eh cache area -->
|
||||
<property name="name">
|
||||
<value>nullPermissionTransactionalCache</value>
|
||||
</property>
|
||||
@@ -69,8 +76,10 @@
|
||||
<bean name="userToAuthoritySharedCache" class="org.alfresco.repo.cache.EhCacheAdapter">
|
||||
<property name="cache">
|
||||
<bean class="org.springframework.cache.ehcache.EhCacheFactoryBean" >
|
||||
<property name="cacheManager">
|
||||
<ref bean="internalEHCacheManager" />
|
||||
</property>
|
||||
<property name="cacheName">
|
||||
<!-- The name of the ehCache area -->
|
||||
<value>userToAuthorityCache</value>
|
||||
</property>
|
||||
<property name="maxElementsInMemory">
|
||||
@@ -92,7 +101,6 @@
|
||||
<property name="cacheManager" >
|
||||
<ref bean="transactionalEHCacheManager" />
|
||||
</property>
|
||||
<!-- Eh cache area -->
|
||||
<property name="name">
|
||||
<value>userToAuthorityTransactionalCache</value>
|
||||
</property>
|
||||
@@ -110,8 +118,10 @@
|
||||
<bean name="permissionsAccessSharedCache" class="org.alfresco.repo.cache.EhCacheAdapter">
|
||||
<property name="cache">
|
||||
<bean class="org.springframework.cache.ehcache.EhCacheFactoryBean" >
|
||||
<property name="cacheManager">
|
||||
<ref bean="internalEHCacheManager" />
|
||||
</property>
|
||||
<property name="cacheName">
|
||||
<!-- The name of the ehCache area -->
|
||||
<value>permissionsAccessCache</value>
|
||||
</property>
|
||||
<property name="maxElementsInMemory">
|
||||
@@ -151,8 +161,10 @@
|
||||
<bean name="nodeOwnerSharedCache" class="org.alfresco.repo.cache.EhCacheAdapter">
|
||||
<property name="cache">
|
||||
<bean class="org.springframework.cache.ehcache.EhCacheFactoryBean" >
|
||||
<property name="cacheManager">
|
||||
<ref bean="internalEHCacheManager" />
|
||||
</property>
|
||||
<property name="cacheName">
|
||||
<!-- The name of the ehCache area -->
|
||||
<value>nodeOwnerCache</value>
|
||||
</property>
|
||||
<property name="maxElementsInMemory">
|
||||
@@ -174,7 +186,6 @@
|
||||
<property name="cacheManager" >
|
||||
<ref bean="transactionalEHCacheManager" />
|
||||
</property>
|
||||
<!-- Eh cache area -->
|
||||
<property name="name">
|
||||
<value>nodeOwnerTransactionalCache</value>
|
||||
</property>
|
||||
|
@@ -823,11 +823,4 @@
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!-- caching -->
|
||||
<bean name="ehCacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
|
||||
<property name="configLocation">
|
||||
<value>classpath:ehcache.xml</value>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
|
@@ -7,7 +7,7 @@ hibernate.show_sql=false
|
||||
hibernate.hbm2ddl.auto=update
|
||||
hibernate.cache.use_query_cache=true
|
||||
hibernate.max_fetch_depth=10
|
||||
hibernate.cache.provider_class=org.hibernate.cache.EhCacheProvider
|
||||
hibernate.cache.provider_class=org.alfresco.repo.cache.InternalEhCacheManagerFactoryBean
|
||||
hibernate.cache.use_second_level_cache=true
|
||||
hibernate.default_batch_fetch_size=1
|
||||
hibernate.jdbc.batch_size=32
|
||||
|
178
config/alfresco/ehcache-default.xml
Normal file
178
config/alfresco/ehcache-default.xml
Normal file
@@ -0,0 +1,178 @@
|
||||
<ehcache>
|
||||
<!-- defaults -->
|
||||
<diskStore
|
||||
path="java.io.tmpdir"/>
|
||||
<defaultCache
|
||||
maxElementsInMemory="5000"
|
||||
eternal="true"
|
||||
timeToIdleSeconds="0"
|
||||
timeToLiveSeconds="0"
|
||||
overflowToDisk="false"
|
||||
/>
|
||||
<!-- Hibernate usage -->
|
||||
<cache
|
||||
name="org.hibernate.cache.StandardQueryCache"
|
||||
maxElementsInMemory="50"
|
||||
eternal="true"
|
||||
timeToLiveSeconds="0"
|
||||
overflowToDisk="false"/>
|
||||
<!-- approx 1MB memory required -->
|
||||
<cache
|
||||
name="org.hibernate.cache.UpdateTimestampsCache"
|
||||
maxElementsInMemory="5000"
|
||||
eternal="true"
|
||||
overflowToDisk="false"/>
|
||||
<!-- approx 40MB memory required -->
|
||||
<cache
|
||||
name="org.alfresco.repo.domain.hibernate.NodeImpl"
|
||||
maxElementsInMemory="10000"
|
||||
eternal="true"
|
||||
timeToIdleSeconds="0"
|
||||
timeToLiveSeconds="0"
|
||||
overflowToDisk="false"
|
||||
/>
|
||||
<!-- approx 20MB memory required -->
|
||||
<cache
|
||||
name="org.alfresco.repo.domain.hibernate.NodeStatusImpl"
|
||||
maxElementsInMemory="5000"
|
||||
eternal="true"
|
||||
timeToIdleSeconds="0"
|
||||
timeToLiveSeconds="0"
|
||||
overflowToDisk="false"
|
||||
/>
|
||||
<!-- approx 40MB memory required -->
|
||||
<cache
|
||||
name="org.alfresco.repo.domain.hibernate.NodeImpl.aspects"
|
||||
maxElementsInMemory="10000"
|
||||
eternal="true"
|
||||
timeToIdleSeconds="0"
|
||||
timeToLiveSeconds="0"
|
||||
overflowToDisk="false"
|
||||
/>
|
||||
<!-- approx 50MB memory required -->
|
||||
<cache
|
||||
name="org.alfresco.repo.domain.hibernate.NodeImpl.properties"
|
||||
maxElementsInMemory="10000"
|
||||
eternal="true"
|
||||
timeToIdleSeconds="0"
|
||||
timeToLiveSeconds="0"
|
||||
overflowToDisk="false"
|
||||
/>
|
||||
<!-- approx 50MB memory required -->
|
||||
<cache
|
||||
name="org.alfresco.repo.domain.hibernate.NodeImpl.childAssocs"
|
||||
maxElementsInMemory="25000"
|
||||
eternal="true"
|
||||
timeToIdleSeconds="0"
|
||||
timeToLiveSeconds="0"
|
||||
overflowToDisk="false"
|
||||
/>
|
||||
<!-- approx 40MB memory required -->
|
||||
<cache
|
||||
name="org.alfresco.repo.domain.hibernate.NodeImpl.parentAssocs"
|
||||
maxElementsInMemory="10000"
|
||||
eternal="true"
|
||||
timeToIdleSeconds="0"
|
||||
timeToLiveSeconds="0"
|
||||
overflowToDisk="false"
|
||||
/>
|
||||
<!-- approx 40MB memory required -->
|
||||
<cache
|
||||
name="org.alfresco.repo.domain.hibernate.ChildAssocImpl"
|
||||
maxElementsInMemory="25000"
|
||||
eternal="true"
|
||||
timeToIdleSeconds="0"
|
||||
timeToLiveSeconds="0"
|
||||
overflowToDisk="false"
|
||||
/>
|
||||
<!-- approx 20MB memory required -->
|
||||
<cache
|
||||
name="org.alfresco.repo.domain.hibernate.NodeImpl.sourceNodeAssocs"
|
||||
maxElementsInMemory="5000"
|
||||
eternal="true"
|
||||
timeToIdleSeconds="0"
|
||||
timeToLiveSeconds="0"
|
||||
overflowToDisk="false"
|
||||
/>
|
||||
<!-- approx 20MB memory required -->
|
||||
<cache
|
||||
name="org.alfresco.repo.domain.hibernate.NodeImpl.targetNodeAssocs"
|
||||
maxElementsInMemory="5000"
|
||||
eternal="true"
|
||||
timeToIdleSeconds="0"
|
||||
timeToLiveSeconds="0"
|
||||
overflowToDisk="false"
|
||||
/>
|
||||
<!-- general use node associations are not common -->
|
||||
<cache
|
||||
name="org.alfresco.repo.domain.hibernate.NodeAssocImpl"
|
||||
maxElementsInMemory="1000"
|
||||
eternal="true"
|
||||
timeToIdleSeconds="0"
|
||||
timeToLiveSeconds="0"
|
||||
overflowToDisk="false"
|
||||
/>
|
||||
<!-- low numbers of objects expected -->
|
||||
<cache
|
||||
name="org.alfresco.repo.domain.hibernate.StoreImpl"
|
||||
maxElementsInMemory="100"
|
||||
eternal="true"
|
||||
timeToIdleSeconds="0"
|
||||
timeToLiveSeconds="0"
|
||||
overflowToDisk="false"
|
||||
/>
|
||||
<!-- version counters -->
|
||||
<cache
|
||||
name="org.alfresco.repo.domain.hibernate.VersionCountImpl"
|
||||
maxElementsInMemory="100"
|
||||
eternal="true"
|
||||
timeToIdleSeconds="0"
|
||||
timeToLiveSeconds="0"
|
||||
overflowToDisk="false"
|
||||
/>
|
||||
<!-- approx 0.1MB memory required -->
|
||||
<cache
|
||||
name="org.alfresco.repo.domain.hibernate.AppliedPatchImpl"
|
||||
maxElementsInMemory="100"
|
||||
eternal="true"
|
||||
timeToIdleSeconds="0"
|
||||
timeToLiveSeconds="60"
|
||||
overflowToDisk="false"
|
||||
/>
|
||||
<!-- Permission related caches -->
|
||||
<!-- approx 40MB memory required -->
|
||||
<cache
|
||||
name="org.alfresco.repo.security.permissions.impl.hibernate.RecipientImpl"
|
||||
maxElementsInMemory="10000"
|
||||
eternal="true"
|
||||
overflowToDisk="false"/>
|
||||
<!-- approx 2MB memory required -->
|
||||
<cache
|
||||
name="org.alfresco.repo.security.permissions.impl.hibernate.PermissionReferenceImpl"
|
||||
maxElementsInMemory="500"
|
||||
eternal="true"
|
||||
overflowToDisk="false"/>
|
||||
<!-- approx 35MB memory required -->
|
||||
<cache
|
||||
name="org.alfresco.repo.security.permissions.impl.hibernate.PermissionEntryImpl"
|
||||
maxElementsInMemory="25000"
|
||||
eternal="true"
|
||||
overflowToDisk="false"/>
|
||||
<!-- approx 40MB memory required -->
|
||||
<cache
|
||||
name="org.alfresco.repo.security.permissions.impl.hibernate.NodePermissionEntryImpl"
|
||||
maxElementsInMemory="10000"
|
||||
eternal="true"
|
||||
overflowToDisk="false"/>
|
||||
<!-- approx 40MB memory required -->
|
||||
<cache
|
||||
name="org.alfresco.repo.security.permissions.impl.hibernate.NodePermissionEntryImpl.permissionEntries"
|
||||
maxElementsInMemory="10000"
|
||||
eternal="true"
|
||||
overflowToDisk="false"/>
|
||||
<cache
|
||||
name="org.alfresco.repo.security.permissions.impl.hibernate.RecipientImpl.externalKeys"
|
||||
maxElementsInMemory="5000"
|
||||
eternal="true"
|
||||
overflowToDisk="false"/>
|
||||
</ehcache>
|
14
config/alfresco/ehcache-transactional.xml
Normal file
14
config/alfresco/ehcache-transactional.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<!--
|
||||
This configures the cache properties for Alfresco's in-transaction caches.
|
||||
-->
|
||||
<ehcache>
|
||||
<diskStore
|
||||
path="java.io.tmpdir"/>
|
||||
<defaultCache
|
||||
maxElementsInMemory="5000"
|
||||
eternal="true"
|
||||
timeToIdleSeconds="0"
|
||||
timeToLiveSeconds="0"
|
||||
overflowToDisk="false"
|
||||
/>
|
||||
</ehcache>
|
Reference in New Issue
Block a user