jmcnally    2002/06/04 14:31:24

  Modified:    src/java/org/apache/torque/manager MethodResultCache.java
  Log:
  removed key map that was not being used.
  
  added group map clear when the cache is cleared.
  
  changed logging format to include stacktrace.
  
  Revision  Changes    Path
  1.9       +19 -35    
jakarta-turbine-torque/src/java/org/apache/torque/manager/MethodResultCache.java
  
  Index: MethodResultCache.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-torque/src/java/org/apache/torque/manager/MethodResultCache.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- MethodResultCache.java    19 May 2002 20:53:55 -0000      1.8
  +++ MethodResultCache.java    4 Jun 2002 21:31:23 -0000       1.9
  @@ -71,7 +71,7 @@
    * This class provides a cache for convenient storage of method results
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>John McNally</a>
  - * @version $Id: MethodResultCache.java,v 1.8 2002/05/19 20:53:55 jmcnally Exp $
  + * @version $Id: MethodResultCache.java,v 1.9 2002/06/04 21:31:23 jmcnally Exp $
    */
   public class MethodResultCache 
   {
  @@ -81,7 +81,6 @@
       private static final String keyClassName =
           "org.apache.torque.manager.MethodCacheKey";
       private ObjectPool pool;
  -    private Map keys;
       private GroupCacheAccess jcsCache;
       private boolean lockCache;
       private int inGet;
  @@ -90,7 +89,7 @@
       public MethodResultCache(GroupCacheAccess cache)
           throws TorqueException
       {
  -        keys = new WeakHashMap();            
  +        // keys = new WeakHashMap();            
           this.jcsCache = cache;            
           groups = new HashMap();
           pool = new StackObjectPool(new MethodCacheKey.Factory(), 10000);
  @@ -103,22 +102,7 @@
               try
               {
                   jcsCache.remove();
  -
  -                // clear out local map of keys, return to pool
  -                Iterator i = keys.keySet().iterator();
  -                while (i.hasNext()) 
  -                {
  -                    try
  -                    {
  -                        pool.returnObject(i.next());
  -                    }
  -                    catch (Exception e)
  -                    {
  -                        log.warn(
  -                            "Nonfatal error. Could not return key to pool", e);
  -                    }
  -                }
  -                keys.clear();
  +                groups.clear();
               }
               catch (CacheException ce)
               {
  @@ -269,7 +253,7 @@
               }
               catch (Exception e)
               {
  -                log.error(e);
  +                log.error("", e);
               }            
           }
           return result;
  @@ -299,7 +283,7 @@
               }
               catch (Exception e)
               {
  -                log.error(e);
  +                log.error("", e);
               }
           }
           return result;
  @@ -329,7 +313,7 @@
               }
               catch (Exception e)
               {
  -                log.error(e);
  +                log.error("", e);
               }
           }
           return result;
  @@ -360,7 +344,7 @@
               }
               catch (Exception e)
               {
  -                log.error(e);
  +                log.error("", e);
               }
           }
           return result;
  @@ -389,7 +373,7 @@
               }
               catch (Exception e)
               {
  -                log.error(e);
  +                log.error("", e);
               }
           }
           return result;
  @@ -406,7 +390,7 @@
           }
           catch (Exception e)
           {
  -            log.error(e);
  +            log.error("", e);
           }
       }
   
  @@ -422,7 +406,7 @@
           }
           catch (Exception e)
           {
  -            log.error(e);
  +            log.error("", e);
           }
       }
   
  @@ -438,7 +422,7 @@
           }
           catch (Exception e)
           {
  -            log.error(e);
  +            log.error("", e);
           }
       }
   
  @@ -454,7 +438,7 @@
           }
           catch (Exception e)
           {
  -            log.error(e);
  +            log.error("", e);
           }
       }
   
  @@ -469,7 +453,7 @@
           }
           catch (Exception e)
           {
  -            log.error(e);
  +            log.error("", e);
           }
       }
   
  @@ -498,7 +482,7 @@
               }
               catch (Exception e)
               {
  -                log.error(e);
  +                log.error("", e);
               }            
           }
       }
  @@ -527,7 +511,7 @@
               }
               catch (Exception e)
               {
  -                log.error(e);
  +                log.error("", e);
               }            
           }
           return result;
  @@ -557,7 +541,7 @@
               }
               catch (Exception e)
               {
  -                log.error(e);
  +                log.error("", e);
               }
           }
           return result;
  @@ -587,7 +571,7 @@
               }
               catch (Exception e)
               {
  -                log.error(e);
  +                log.error("", e);
               }
           }
           return result;
  @@ -618,7 +602,7 @@
               }
               catch (Exception e)
               {
  -                log.error(e);
  +                log.error("", e);
               }
           }
           return result;
  @@ -647,7 +631,7 @@
               }
               catch (Exception e)
               {
  -                log.error(e);
  +                log.error("", e);
               }
           }
           return result;
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to