← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 17203: Replaced hazelcast with ehcache for now. Will find a way to configure hazelcast externally.

 

------------------------------------------------------------
revno: 17203
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2014-10-22 09:06:45 +0200
message:
  Replaced hazelcast with ehcache for now. Will find a way to configure hazelcast externally.
removed:
  dhis-2/dhis-support/dhis-support-hibernate/src/main/resources/hazelcast.xml
added:
  dhis-2/dhis-support/dhis-support-hibernate/src/main/resources/ehcache.xml
modified:
  dhis-2/dhis-support/dhis-support-hibernate/pom.xml
  dhis-2/dhis-support/dhis-support-hibernate/src/main/resources/hibernate-default.properties
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/WEB-INF/classes/log4j.properties
  dhis-2/pom.xml


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-support/dhis-support-hibernate/pom.xml'
--- dhis-2/dhis-support/dhis-support-hibernate/pom.xml	2014-07-23 14:53:00 +0000
+++ dhis-2/dhis-support/dhis-support-hibernate/pom.xml	2014-10-22 07:06:45 +0000
@@ -33,12 +33,8 @@
       <artifactId>hibernate-core</artifactId>
     </dependency>
     <dependency>
-	  <groupId>com.hazelcast</groupId>
-	  <artifactId>hazelcast</artifactId>
-    </dependency> 
-    <dependency>
-	  <groupId>com.hazelcast</groupId>
-	  <artifactId>hazelcast-hibernate4</artifactId>
+      <groupId>org.hibernate</groupId>
+      <artifactId>hibernate-ehcache</artifactId>
     </dependency>
     <dependency>
       <groupId>org.hibernate</groupId>

=== added file 'dhis-2/dhis-support/dhis-support-hibernate/src/main/resources/ehcache.xml'
--- dhis-2/dhis-support/dhis-support-hibernate/src/main/resources/ehcache.xml	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-support/dhis-support-hibernate/src/main/resources/ehcache.xml	2014-10-22 07:06:45 +0000
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ehcache>
+
+  <defaultCache maxElementsInMemory="800000" eternal="false" timeToIdleSeconds="360" timeToLiveSeconds="720"
+    overflowToDisk="false" diskPersistent="false" />
+
+  <!-- Hibernate Query Cache -->
+
+  <cache name="org.hibernate.cache.internal.StandardQueryCache" maxElementsInMemory="250000" />
+
+  <cache name="org.hibernate.cache.spi.UpdateTimestampsCache" maxElementsInMemory="3000" />
+</ehcache>
\ No newline at end of file

=== removed file 'dhis-2/dhis-support/dhis-support-hibernate/src/main/resources/hazelcast.xml'
--- dhis-2/dhis-support/dhis-support-hibernate/src/main/resources/hazelcast.xml	2014-10-13 15:03:41 +0000
+++ dhis-2/dhis-support/dhis-support-hibernate/src/main/resources/hazelcast.xml	1970-01-01 00:00:00 +0000
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<hazelcast xsi:schemaLocation="http://www.hazelcast.com/schema/config hazelcast-config-3.2.xsd"
-  xmlns="http://www.hazelcast.com/schema/config";
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
-  <!--
-  <group>
-      <name>dhis-hz-cluster</name>
-      <password>dhis-hz-cluster</password>
-  </group>
-  <network>
-      <port auto-increment="true" port-count="100">5701</port>
-      <outbound-ports>
-          <ports>0</ports>
-      </outbound-ports>
-      <join>
-          <multicast enabled="false">
-              <multicast-group>224.2.2.3</multicast-group>
-              <multicast-port>54327</multicast-port>
-          </multicast>
-          <tcp-ip enabled="true">
-              <member>127.0.0.1</member>
-          </tcp-ip>
-      </join>
-  </network>
-   -->
-  <properties>
-    <property name="hazelcast.rest.enabled">false</property>
-    <property name="hazelcast.socket.bind.any">false</property>
-    <property name="hazelcast.logging.type">log4j</property>
-  </properties>
-  <network>
-    <interfaces enabled="true">
-      <interface>127.0.0.1</interface>
-    </interfaces>
-  </network>
-  <map name="default">
-    <time-to-live-seconds>720</time-to-live-seconds>
-    <max-size policy="PER_NODE">800000</max-size>
-    <eviction-policy>LRU</eviction-policy>
-  </map>
-</hazelcast>

=== modified file 'dhis-2/dhis-support/dhis-support-hibernate/src/main/resources/hibernate-default.properties'
--- dhis-2/dhis-support/dhis-support-hibernate/src/main/resources/hibernate-default.properties	2014-10-13 13:37:50 +0000
+++ dhis-2/dhis-support/dhis-support-hibernate/src/main/resources/hibernate-default.properties	2014-10-22 07:06:45 +0000
@@ -28,10 +28,10 @@
 
 # Caching
 
+hibernate.cache.region.factory_class = org.hibernate.cache.ehcache.EhCacheRegionFactory
 hibernate.cache.use_second_level_cache = true
 hibernate.cache.use_query_cache = true
-hibernate.cache.region.factory_class = com.hazelcast.hibernate.HazelcastLocalCacheRegionFactory
-# hibernate.cache.region.factory_class = org.hibernate.cache.ehcache.EhCacheRegionFactory
+#hibernate.cache.region.factory_class = com.hazelcast.hibernate.HazelcastLocalCacheRegionFactory
 
 # MySQL setup
 #

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/WEB-INF/classes/log4j.properties'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/WEB-INF/classes/log4j.properties	2014-10-13 15:36:50 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/WEB-INF/classes/log4j.properties	2014-10-22 07:06:45 +0000
@@ -29,6 +29,7 @@
 # log4j.logger.org.hibernate.engine.internal.StatefulPersistenceContext = ERROR
 # log4j.logger.org.hibernate.engine.StatefulPersistenceContext.ProxyWarnLog = ERROR
 log4j.logger.org.hibernate.cache.ehcache.internal.strategy.AbstractReadWriteEhcacheAccessStrategy = ERROR
+log4j.logger.org.hibernate.cache.ehcache.AbstractEhcacheRegionFactory = ERROR
 
 # Spring framework logging level
 log4j.logger.org.springframework = WARN

=== modified file 'dhis-2/pom.xml'
--- dhis-2/pom.xml	2014-10-13 13:27:11 +0000
+++ dhis-2/pom.xml	2014-10-22 07:06:45 +0000
@@ -699,12 +699,7 @@
         <groupId>org.hibernate</groupId>
         <artifactId>hibernate-core</artifactId>
         <version>${hibernate.version}</version>
-      </dependency> 
-      <dependency>
-	    <groupId>com.hazelcast</groupId>
-	    <artifactId>hazelcast-hibernate4</artifactId>
-	    <version>3.2.1</version>
-      </dependency>    
+      </dependency>
       <dependency>
         <groupId>org.hibernate</groupId>
         <artifactId>hibernate-entitymanager</artifactId>
@@ -715,6 +710,11 @@
         <artifactId>hibernate-validator</artifactId>
         <version>${hibernate-validator.version}</version>
       </dependency>
+      <dependency>
+        <groupId>org.hibernate</groupId>
+        <artifactId>hibernate-ehcache</artifactId>
+        <version>${hibernate.version}</version>
+      </dependency>
       <!-- javassist in use by hibernate - make sure versions are kept in sync  -->
       <dependency>
 	    <groupId>org.javassist</groupId>
@@ -722,11 +722,6 @@
 	    <version>3.15.0-GA</version>
       </dependency>
       <dependency>
-	    <groupId>com.hazelcast</groupId>
-	    <artifactId>hazelcast</artifactId>
-	    <version>3.2.1</version>
-      </dependency>
-      <dependency>
         <groupId>javax.validation</groupId>
         <artifactId>validation-api</artifactId>
         <version>1.0.0.GA</version>