[jboss-cvs] JBossCache/src-50/org/jboss/cache/pojo/interceptors/dynamic ...

Ben Wang bwang at jboss.com
Wed Jul 26 03:59:13 EDT 2006


  User: bwang   
  Date: 06/07/26 03:59:13

  Modified:    src-50/org/jboss/cache/pojo/interceptors/dynamic 
                        CacheFieldInterceptor.java
  Log:
  JBCACHE-713 Remote detach can throw PojoCacheAlreadyDetachedException.
  
  Revision  Changes    Path
  1.8       +4 -13     JBossCache/src-50/org/jboss/cache/pojo/interceptors/dynamic/CacheFieldInterceptor.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: CacheFieldInterceptor.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src-50/org/jboss/cache/pojo/interceptors/dynamic/CacheFieldInterceptor.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -b -r1.7 -r1.8
  --- CacheFieldInterceptor.java	20 Jul 2006 02:43:38 -0000	1.7
  +++ CacheFieldInterceptor.java	26 Jul 2006 07:59:13 -0000	1.8
  @@ -23,6 +23,7 @@
   import org.jboss.cache.pojo.PojoTreeCache;
   import org.jboss.cache.pojo.CachedType;
   import org.jboss.cache.pojo.PojoInstance;
  +import org.jboss.cache.pojo.PojoCacheAlreadyDetachedException;
   import org.jboss.cache.pojo.impl.PojoCacheImpl;
   
   import java.lang.reflect.Field;
  @@ -161,19 +162,11 @@
                  return result;
               else
               {
  -               // TODO There is a chance of recursive loop here if caller tries to print out obj that will trigger the fieldRead interception.
                  Object value = invocation.getTargetObject();
                  if (value == null || field.get(value) == null)   // if both are null, we know this is null as well.
                     return null;
  -               else
  -               {
  -                  if (log_.isTraceEnabled())
  -                  {
  -                     log_.trace("invoke(): DataNode on fqn_: " + fqn_ + " has obviously been evicted. Will need to reconstruct it");
  -                  }
   
  -                  pCache_.putObject(fqn_, value);
  -               }
  +               isPojoDetached(invocation);
               }
            }
         }
  @@ -227,11 +220,9 @@
            CacheFieldInterceptor interceptor = (CacheFieldInterceptor) AopUtil.findCacheInterceptor(advisor);
            if (interceptor != null)
            {
  -            if (log_.isDebugEnabled())
  -            {
  -               log_.debug("isPojoDetached(): removed cache interceptor fqn_: " + fqn_ + " interceptor: " + interceptor);
  -            }
               advisor.removeInterceptor(interceptor.getName());
  +            throw new PojoCacheAlreadyDetachedException("pojo: " +obj.getClass() +
  +                    " has possibly been detached remotely. Internal id: " + interceptor.getFqn());
            }
         }
   
  
  
  



More information about the jboss-cvs-commits mailing list