debugging DatabaseCache
authoridfx <idfx>
Wed, 6 Feb 2002 20:05:54 +0000 (20:05 +0000)
committeridfx <idfx>
Wed, 6 Feb 2002 20:05:54 +0000 (20:05 +0000)
source/mir/storage/Database.java
source/mir/storage/DatabaseCache.java

index 26e35c2..3cfc3b4 100755 (executable)
@@ -525,6 +525,7 @@ public class Database implements StorageObject {
       if (cache != null && theResultHash.containsKey(thePKeyName) &&
             (cache.containsKey((String)theResultHash.get(thePKeyName)) > -1)) {
         //theLog.printDebugInfo("CACHE: (out) "+ theResultHash.get(thePKeyName)+ " :"+theTable);
+        
         returnEntity = (Entity)cache.get((String)theResultHash.get(thePKeyName));
       }
       else {
index 1c38842..88b3182 100755 (executable)
@@ -45,7 +45,7 @@ public class DatabaseCache {
   
   public int containsValue(Object o){
     for(int i = 0; i<_cache.size(); i++){
-      if(((Entry)_cache.get(i)).getValue().equals(o) )
+      if( _cache.get(i)!=null && ((Entry)_cache.get(i)).getValue().equals(o) )
         return i;
     }
     return -1;