[exo-jcr-commits] exo-jcr SVN: r1098 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache.

do-not-reply at jboss.org do-not-reply at jboss.org
Wed Dec 16 09:22:11 EST 2009


Author: nfilotto
Date: 2009-12-16 09:22:11 -0500 (Wed, 16 Dec 2009)
New Revision: 1098

Modified:
   jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionContextHolder.java
Log:
EXOJCR-321: Prevent useless database access for the methods add(NodeData) and add(PropertyData)
disable this improvement for special uuid

Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionContextHolder.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionContextHolder.java	2009-12-16 14:15:14 UTC (rev 1097)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionContextHolder.java	2009-12-16 14:22:11 UTC (rev 1098)
@@ -18,6 +18,7 @@
  */
 package org.exoplatform.services.jcr.impl.storage.jbosscache;
 
+import org.exoplatform.services.jcr.impl.Constants;
 import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCStorageConnection;
 import org.exoplatform.services.jcr.storage.WorkspaceDataContainer;
 
@@ -202,6 +203,10 @@
 
       public void addNewItemsId(String id)
       {
+         if (!validUUID(id))
+         {
+            return;
+         }
          if (newItemsId == null)
          {
             this.newItemsId = new HashSet<String>();
@@ -218,5 +223,16 @@
          connection.close();
          connection = null;         
       }
+      
+      /**
+       * Checks if the given uuid is a real one
+       */
+      private boolean validUUID(String uuid)
+      {
+         boolean isSpecial =
+            Constants.ROOT_UUID.endsWith(uuid) || Constants.SYSTEM_UUID.endsWith(uuid)
+               || Constants.VERSIONSTORAGE_UUID.endsWith(uuid) || Constants.NODETYPESROOT_UUID.endsWith(uuid);
+         return !isSpecial;
+      }
    }
 }



More information about the exo-jcr-commits mailing list