jmcnally    02/05/06 11:49:28

  Modified:    src/java/org/apache/torque/manager MethodResultCache.java
  Log:
  do not return the key to the pool if it was passed into the method.  The
  calling method should be responsible for returning the key to the pool.
  
  Also make sure to remove the group name from the set of active groups, if it
  is invalidated.
  
  Revision  Changes    Path
  1.7       +4 -11     
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.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- MethodResultCache.java    15 Apr 2002 16:24:06 -0000      1.6
  +++ MethodResultCache.java    6 May 2002 18:49:28 -0000       1.7
  @@ -63,7 +63,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.6 2002/04/15 16:24:06 kschrader Exp $
  + * @version $Id: MethodResultCache.java,v 1.7 2002/05/06 18:49:28 jmcnally Exp $
    */
   public class MethodResultCache 
   {
  @@ -220,15 +220,6 @@
                           Thread.yield();
                       }
                       jcsCache.remove(key, key.getGroupKey());
  -                    try
  -                    {
  -                        pool.returnObject(key);
  -                    }
  -                    catch (Exception e)
  -                    {
  -                        log.warn(
  -                            "Nonfatal error. Could not return key to pool", e);
  -                    }
                   }
                   // jcs does not throw an exception here, might remove this
                   catch (Exception ce) 
  @@ -484,7 +475,9 @@
                   MethodCacheKey key = 
                       (MethodCacheKey)pool.borrowObject();
                   key.init(instanceOrClass, method);
  -                jcsCache.invalidateGroup(key.getGroupKey());
  +                String groupName = key.getGroupKey();
  +                jcsCache.invalidateGroup(groupName);
  +                groups.remove(groupName);
                   try
                   {
                       pool.returnObject(key);
  
  
  

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

Reply via email to