You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by do...@apache.org on 2009/10/08 21:49:57 UTC

svn commit: r823298 - /ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/UtilCache.java

Author: doogie
Date: Thu Oct  8 19:49:57 2009
New Revision: 823298

URL: http://svn.apache.org/viewvc?rev=823298&view=rev
Log:
Don't create CacheLineTable each time setPropertiesParam is called.

Modified:
    ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/UtilCache.java

Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/UtilCache.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/UtilCache.java?rev=823298&r1=823297&r2=823298&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/UtilCache.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/UtilCache.java Thu Oct  8 19:49:57 2009
@@ -114,6 +114,7 @@
         name = cacheName + this.getNextDefaultIndex(cacheName);
 
         setPropertiesParams(cacheName);
+        createCache();
 
         utilCacheTable.put(name, this);
     }
@@ -143,6 +144,7 @@
         String name = "specified" + this.getNextDefaultIndex("specified");
 
         setPropertiesParams(name);
+        createCache();
 
         utilCacheTable.put(name, this);
     }
@@ -157,6 +159,7 @@
 
         setPropertiesParams("default");
         setPropertiesParams(cacheName);
+        createCache();
 
         utilCacheTable.put(name, this);
     }
@@ -265,7 +268,9 @@
                 Debug.logWarning(e, "Error getting cache.file.store value from cache.properties file for propNames: " + propNames, module);
             }
         }
+    }
 
+    private void createCache() {
         int maxMemSize = this.maxInMemory;
         if (maxMemSize == 0) maxMemSize = maxSize;
         this.cacheLineTable = new CacheLineTable<K, V>(this.fileStore, this.name, this.useFileSystemStore, maxMemSize);