[jbosscache-commits] JBoss Cache SVN: r6284 - core/trunk/src/main/java/org/jboss/cache.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Tue Jul 15 14:49:16 EDT 2008


Author: manik.surtani at jboss.com
Date: 2008-07-15 14:49:16 -0400 (Tue, 15 Jul 2008)
New Revision: 6284

Modified:
   core/trunk/src/main/java/org/jboss/cache/UnversionedNode.java
Log:
less time in a sync block!

Modified: core/trunk/src/main/java/org/jboss/cache/UnversionedNode.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/UnversionedNode.java	2008-07-15 18:32:47 UTC (rev 6283)
+++ core/trunk/src/main/java/org/jboss/cache/UnversionedNode.java	2008-07-15 18:49:16 UTC (rev 6284)
@@ -285,21 +285,18 @@
                if (notify) cache.getNotifier().notifyNodeCreated(childFqn, true, ctx);
                child = newChild;
                children.put(childName, child);
-
-               if (gtx != null)
-               {
-                  CreateNodeCommand createNodeCommand = commandsFactory.buildCreateNodeCommand(childFqn);
-                  ctx.getTransactionContext().addModification(createNodeCommand);
-               }
             }
          }
 
          // notify if we actually created a new child
          if (newChild == child)
          {
-            if (trace)
+            if (trace) log.trace("created child: fqn=" + childFqn);
+
+            if (gtx != null)
             {
-               log.trace("created child: fqn=" + childFqn);
+               CreateNodeCommand createNodeCommand = commandsFactory.buildCreateNodeCommand(childFqn);
+               ctx.getTransactionContext().addModification(createNodeCommand);
             }
             if (notify) cache.getNotifier().notifyNodeCreated(childFqn, false, ctx);
          }
@@ -351,40 +348,37 @@
 
       if (data != null)
       {
-         synchronized (data)
+         if (trace)
          {
-            if (trace)
+            sb.append(" data=").append(data.keySet());
+         }
+         else
+         {
+            sb.append(" data=[");
+            Set keys = data.keySet();
+            int i = 0;
+            for (Object o : keys)
             {
-               sb.append(" data=").append(data.keySet());
-            }
-            else
-            {
-               sb.append(" data=[");
-               Set keys = data.keySet();
-               int i = 0;
-               for (Object o : keys)
-               {
-                  i++;
-                  sb.append(o);
+               i++;
+               sb.append(o);
 
-                  if (i == 5)
+               if (i == 5)
+               {
+                  int more = keys.size() - 5;
+                  if (more > 1)
                   {
-                     int more = keys.size() - 5;
-                     if (more > 1)
-                     {
-                        sb.append(", and ");
-                        sb.append(more);
-                        sb.append(" more");
-                        break;
-                     }
+                     sb.append(", and ");
+                     sb.append(more);
+                     sb.append(" more");
+                     break;
                   }
-                  else
-                  {
-                     sb.append(", ");
-                  }
                }
-               sb.append("]");
+               else
+               {
+                  sb.append(", ");
+               }
             }
+            sb.append("]");
          }
       }
       if (children != null && !children.isEmpty())




More information about the jbosscache-commits mailing list