[jbosscache-commits] JBoss Cache SVN: r5289 - pojo/trunk/src/main/java/org/jboss/cache/pojo/interceptors.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Mon Feb 4 23:22:07 EST 2008


Author: jason.greene at jboss.com
Date: 2008-02-04 23:22:07 -0500 (Mon, 04 Feb 2008)
New Revision: 5289

Modified:
   pojo/trunk/src/main/java/org/jboss/cache/pojo/interceptors/PojoTxLockInterceptor.java
Log:
Do not lock the parent node


Modified: pojo/trunk/src/main/java/org/jboss/cache/pojo/interceptors/PojoTxLockInterceptor.java
===================================================================
--- pojo/trunk/src/main/java/org/jboss/cache/pojo/interceptors/PojoTxLockInterceptor.java	2008-02-05 03:58:08 UTC (rev 5288)
+++ pojo/trunk/src/main/java/org/jboss/cache/pojo/interceptors/PojoTxLockInterceptor.java	2008-02-05 04:22:07 UTC (rev 5289)
@@ -64,32 +64,18 @@
 
       boolean isNeeded = true;
       int retry = 0;
-      // If this is an internal id and also it has three levels, we are saying this is
-      // Collection, and we need to lock the parent as well.
-      // TODO Still a bit ad hoc.
-      Fqn realId = id;
-      if (id.isChildOrEquals(InternalConstant.JBOSS_INTERNAL) && id.size() > 2)
-      {
-         realId = id.getParent();
-         if (log.isDebugEnabled())
-         {
-            log.debug("lockPojo(): will lock parent id instead:" + realId);
-         }
-      }
-
+   
       while (isNeeded)
       {
          try
          {
-            cache.put(realId, LOCK_KEY, "LOCK");
+            cache.put(id, LOCK_KEY, "LOCK");
             isNeeded = false;
          }
          catch (UpgradeException upe)
          {
-            log.warn("lockPojo(): can't upgrade the lock during lockPojo. Will re-try. id: " + realId
+            log.warn("lockPojo(): can't upgrade the lock during lockPojo. Will re-try. id: " + id
                      + " retry times: " + retry);
-// TODO is this really ok to comment out??
-//            cache.get(realId).release(owner);
             if (retry++ > RETRY)
             {
                return false;
@@ -101,12 +87,10 @@
             }
             catch (InterruptedException e)
             {
-               ;
             }
          }
       }
 
       return true;
    }
-
 }




More information about the jbosscache-commits mailing list