[exo-jcr-commits] exo-jcr SVN: r899 - 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
Thu Nov 26 21:14:37 EST 2009


Author: pnedonosko
Date: 2009-11-26 21:14:36 -0500 (Thu, 26 Nov 2009)
New Revision: 899

Modified:
   jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java
   jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java
Log:
EXOJCR-270: skip transitive ACL updates on DB level; cleanups

Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java	2009-11-27 02:12:58 UTC (rev 898)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java	2009-11-27 02:14:36 UTC (rev 899)
@@ -294,7 +294,7 @@
       InvalidItemStateException, IllegalStateException
    {
       startBatch();
-      // propsRoot.getChild(makePropFqn(data.getIdentifier()))
+      
       // check if parent is cached
       Node<Serializable, Object> parent = nodesRoot.getChild(makeNodeFqn(data.getParentIdentifier()));
       if (parent == null)

Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java	2009-11-27 02:12:58 UTC (rev 898)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java	2009-11-27 02:14:36 UTC (rev 899)
@@ -89,18 +89,14 @@
    }
 
    /**
-    * Apply all Modifications to JDBC database, but don't commite them.
+    * Apply all Modifications on JDBC database, but don't commit them.
     *
     * @param modifications List if Modification
     * @param conn JDBCStorageConnection
-    * @throws RepositoryException if error 
+    * @throws RepositoryException if error occurs
     */
    protected void apply(List<Modification> modifications, JDBCStorageConnection conn) throws RepositoryException
    {
-      // TODO Prepare modifications list.
-      // Will be added oldValueData to modification for UPDATE. 
-      //prepareModifications(modifications);
-
       for (Modification m : modifications)
       {
          switch (m.getType())
@@ -271,9 +267,10 @@
                // update if it's non transitive update
                if (item.isNode())
                {
-                  if ((item.getState() & TransientItemData.TRANSITIVE_MIXIN_UPDATED) == 0)
+                  if ((item.getState() & TransientItemData.TRANSITIVE_MIXIN_UPDATED) == 0
+                     && (item.getState() & TransientItemData.TRANSITIVE_ACL_UPDATED) == 0)
                   {
-                     // TODO do not handle mixin updates in db; it's a workaround - review logic in the connection
+                     // TODO do not handle mixin or ACL updates in db; it's a workaround - review logic in the connection
 
                      // TODO conn.rename() is used to update all the fields in DB.
                      // Original conn.update() will be matched as deprecated, 
@@ -801,56 +798,4 @@
       throw new JDBCCacheLoaderException("The method 'removeData(Fqn fqn)' should not be called.");
    }
 
-   // etc.
-
-   /**
-    * Prepare list of modifications.
-    * 
-    * Will be checked the UPDATE or ADD.
-    * 
-    * @param modifications
-    * @throws RepositoryException
-    */
-   @Deprecated
-   private void prepareModifications(List<Modification> modifications) throws RepositoryException
-   {
-      WorkspaceStorageConnection conn = dataContainer.openConnection();
-
-      try
-      {
-         for (int i = 0; i < modifications.size(); i++)
-         {
-            Modification m = modifications.get(i);
-            if (m.getType() == ModificationType.PUT_KEY_VALUE)
-            {
-               ItemData itemData = null;
-
-               //Check add or update node data.
-               if (m.getValue() instanceof NodeData)
-               {
-                  NodeData nodeData = (NodeData)m.getValue();
-                  itemData = conn.getItemData(nodeData.getIdentifier());
-
-                  // Set oldValueData for update node.
-                  if (itemData != null)
-                     modifications.get(i).setOldValue(itemData);
-               }
-               else if (m.getValue() instanceof PropertyData)
-               {
-                  PropertyData propertyData = (PropertyData)m.getValue();
-                  itemData = conn.getItemData(propertyData.getIdentifier());
-
-                  // Set oldValueData for update property.
-                  if (itemData != null)
-                     modifications.get(i).setOldValue(itemData);
-               }
-            }
-         }
-      }
-      finally
-      {
-         conn.close();
-      }
-   }
-
 }
\ No newline at end of file



More information about the exo-jcr-commits mailing list