Author: olamy
Date: Tue Jun 28 22:19:30 2011
New Revision: 1140869

URL: http://svn.apache.org/viewvc?rev=1140869&view=rev
Log:
[MRM-1478] Enable DB caching
Submitted by Maria Catherine Tan
patch applied with modifications

Added:
    
archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/resources/ehcache.xml
   (with props)
Modified:
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp/pom.xml
    
archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/applicationContext.xml
    archiva/trunk/pom.xml

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp/pom.xml
URL: 
http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/pom.xml?rev=1140869&r1=1140868&r2=1140869&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp/pom.xml (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp/pom.xml Tue Jun 28 
22:19:30 2011
@@ -358,6 +358,20 @@
       <scope>test</scope>
       <version>${struts.version}</version>
     </dependency>
+    <dependency>
+      <groupId>jpox</groupId>
+      <artifactId>jpox-ehcache</artifactId>
+      <exclusions>
+        <exclusion>
+          <groupId>commons-logging</groupId>
+          <artifactId>commons-logging</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>ehcache</groupId>
+          <artifactId>ehcache</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
   </dependencies>
   <build>
     <resources>
@@ -399,7 +413,7 @@
               <tasks>
                 <mkdir dir="${basedir}/target/archiva/WEB-INF/"/>
                 <copy todir="${basedir}/target/archiva/WEB-INF/">
-                  <fileset dir="${basedir}/target" includes="classes/" 
excludes="**/struts.xml"/>
+                  <fileset dir="${basedir}/target" includes="classes/" 
excludes="**/struts.xml,**/ehcache.xml"/>
                 </copy>
               </tasks>
             </configuration>
@@ -530,25 +544,6 @@
             <artifactId>derby</artifactId>
             <version>10.1.3.1</version>
           </dependency>
-          <!-- Enable the following if you want JSP 2.0 or JVM version < 1.5 
<dependency>
-            <groupId>commons-logging</groupId>
-            <artifactId>commons-logging</artifactId>
-            <version>1.1</version>
-            <type>jar</type>
-          </dependency>
-          <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-jcl</artifactId>
-            <version>1.0.1</version>
-            <type>jar</type>
-          </dependency>
-          <dependency>
-            <groupId>log4j</groupId>
-            <artifactId>log4j</artifactId>
-            <version>1.2.14</version>
-            <type>jar</type>
-          </dependency>
-           -->
         </dependencies>
       </plugin>
       <plugin>

Added: 
archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/resources/ehcache.xml
URL: 
http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/resources/ehcache.xml?rev=1140869&view=auto
==============================================================================
--- 
archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/resources/ehcache.xml
 (added)
+++ 
archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/resources/ehcache.xml
 Tue Jun 28 22:19:30 2011
@@ -0,0 +1,74 @@
+<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
+  <diskStore path="java.io.tmpdir" />
+
+  <!-- make default cache very short lived -->
+
+  <defaultCache
+    maxElementsInMemory="100"
+    maxElementsOnDisk="0"
+    eternal="false"
+    overflowToDisk="false"
+    timeToIdleSeconds="300"
+    timeToLiveSeconds="600"
+    memoryStoreEvictionPolicy="LFU" />
+
+  <!--
+    cache Redback classes longer to avoid a lot of SQL queries
+    See REDBACK-227
+  -->
+  <cache name="defaultJpox"
+      maxElementsInMemory="10000"
+      maxElementsOnDisk="0"
+      eternal="false"
+      overflowToDisk="false"
+      timeToIdleSeconds="1800"
+      timeToLiveSeconds="14400"
+      memoryStoreEvictionPolicy="LFU" />
+
+  <cache name="org.codehaus.plexus.redback.rbac.jdo.JdoOperation"
+    maxElementsInMemory="10000"
+    maxElementsOnDisk="0"
+    eternal="false"
+    overflowToDisk="false"
+    timeToIdleSeconds="1800"
+    timeToLiveSeconds="14400"
+    memoryStoreEvictionPolicy="LFU" />
+
+  <cache name="org.codehaus.plexus.redback.rbac.jdo.JdoPermission"
+    maxElementsInMemory="10000"
+    maxElementsOnDisk="0"
+    eternal="false"
+    overflowToDisk="false"
+    timeToIdleSeconds="1800"
+    timeToLiveSeconds="14400"
+    memoryStoreEvictionPolicy="LFU" />
+
+  <cache name="org.codehaus.plexus.redback.rbac.jdo.JdoResource"
+    maxElementsInMemory="10000"
+    maxElementsOnDisk="0"
+    eternal="false"
+    overflowToDisk="false"
+    timeToIdleSeconds="1800"
+    timeToLiveSeconds="14400"
+    memoryStoreEvictionPolicy="LFU" />
+
+  <cache name="org.codehaus.plexus.redback.rbac.jdo.JdoRole"
+    maxElementsInMemory="10000"
+    maxElementsOnDisk="0"
+    eternal="false"
+    overflowToDisk="false"
+    timeToIdleSeconds="1800"
+    timeToLiveSeconds="14400"
+    memoryStoreEvictionPolicy="LFU" />
+
+  <cache name="org.codehaus.plexus.redback.rbac.jdo.JdoUserAssignment"
+    maxElementsInMemory="10000"
+    maxElementsOnDisk="0"
+    eternal="false"
+    overflowToDisk="false"
+    timeToIdleSeconds="300"
+    timeToLiveSeconds="600"
+    memoryStoreEvictionPolicy="LFU" />
+
+</ehcache>
+

Propchange: 
archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/resources/ehcache.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/resources/ehcache.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: 
archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/applicationContext.xml
URL: 
http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/applicationContext.xml?rev=1140869&r1=1140868&r2=1140869&view=diff
==============================================================================
--- 
archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/applicationContext.xml
 (original)
+++ 
archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/applicationContext.xml
 Tue Jun 28 22:19:30 2011
@@ -159,6 +159,12 @@
         <!-- NEEDED FOR POSTGRES, But causes problems in other JDBC 
implementations.
         <prop key="org.jpox.identifier.case">PreserveCase</prop>
         -->
+
+        <!-- cache activation -->
+        <prop key="org.jpox.cache.level2">true</prop>
+        <prop key="org.jpox.cache.level2.type">ehcacheclassbased</prop>
+        <prop key="org.jpox.cache.level2.cacheName">defaultJpox</prop>
+        <prop key="org.jpox.cache.level2.configurationFile">/ehcache.xml</prop>
       </props>
     </property>
   </bean>

Modified: archiva/trunk/pom.xml
URL: 
http://svn.apache.org/viewvc/archiva/trunk/pom.xml?rev=1140869&r1=1140868&r2=1140869&view=diff
==============================================================================
--- archiva/trunk/pom.xml (original)
+++ archiva/trunk/pom.xml Tue Jun 28 22:19:30 2011
@@ -1133,6 +1133,11 @@
         <version>1.8.3</version>
         <scope>test</scope>
       </dependency>
+      <dependency>
+        <groupId>jpox</groupId>
+        <artifactId>jpox-ehcache</artifactId>
+        <version>1.1.9</version>
+      </dependency>
     </dependencies>
   </dependencyManagement>
 


Reply via email to