[exo-jcr-commits] exo-jcr SVN: r893 - 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 11:21:22 EST 2009


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

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-201: rework of transitive changes apply (mixins and paths)

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-26 15:41:36 UTC (rev 892)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java	2009-11-26 16:21:21 UTC (rev 893)
@@ -727,8 +727,7 @@
       childNode.put(ITEM_ID, data.getIdentifier());
 
       // 4. update all child nodes
-      updateTreePath(node, data.getQPath()); //treePrint(node)
-
+      updateTreePath(node, data.getQPath());
    }
 
    /**

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-26 15:41:36 UTC (rev 892)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java	2009-11-26 16:21:21 UTC (rev 893)
@@ -118,7 +118,13 @@
                }
                break;
             case PUT_KEY_VALUE :
+               if (LOG.isDebugEnabled())
+               {
+                  LOG.debug("PUT_KEY_VALUE modification");
+               }
+
                doUpdate(m, conn);
+
                break;
             case REMOVE_DATA :
                if (LOG.isDebugEnabled())
@@ -133,7 +139,13 @@
                }
                break;
             case REMOVE_NODE :
+               if (LOG.isDebugEnabled())
+               {
+                  LOG.debug("REMOVE_NODE modification");
+               }
+
                doRemove(m, conn);
+
                break;
             case MOVE :
                if (LOG.isDebugEnabled())
@@ -227,16 +239,12 @@
       if (modification.getValue() instanceof NodeData)
       {
          //add node data
-         NodeData nodeData = (NodeData)modification.getValue();
-
-         conn.add(nodeData);
+         conn.add((NodeData)modification.getValue());
       }
       else if (modification.getValue() instanceof PropertyData)
       {
          //add property data
-         PropertyData propertyData = (PropertyData)modification.getValue();
-
-         conn.add(propertyData);
+         conn.add((PropertyData)modification.getValue());
       }
    }
 
@@ -255,24 +263,26 @@
          //Check flag it's mixin update for node, if this flag set we have node need to 
          TransientItemData item = (TransientItemData)m.getValue();
 
-         // TODO try
-         // if ((item.getState() == TransientItemData.TRANSITIVE_NONE)
-
-         if ((item.getState() & TransientItemData.TRANSITIVE_PATH_UPDATED) == 0
-            || (item.getState() & TransientItemData.TRANSITIVE_MIXIN_UPDATED) == 0)
+         if ((item.getState() & TransientItemData.TRANSITIVE_PATH_UPDATED) == 0)
          {
+            // if not a transitive update of path, update it in the database
             if (conn.itemExists((String)m.getFqn().get(1), item.isNode()))
             {
                // update if it's non transitive update
                if (item.isNode())
                {
-                  // TODO conn.rename() is used to update all the fields in DB.
-                  // Original conn.update() will be matched as deprecated, 
-                  // and conn.rename() should be renamed to update. This
-                  // is done to solve the issue, when we need to guess each
-                  // time whether node is moved or just updated. This
-                  // solution is used as the fastest among other. 
-                  conn.rename((NodeData)item);
+                  if ((item.getState() & TransientItemData.TRANSITIVE_MIXIN_UPDATED) == 0)
+                  {
+                     // TODO do not handle mixin 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, 
+                     // and conn.rename() should be renamed to update. This
+                     // is done to solve the issue, when we need to guess each
+                     // time whether node is moved or just updated. This
+                     // solution is used as the fastest among other. 
+                     conn.rename((NodeData)item);
+                  }
                }
                else
                {
@@ -731,7 +741,7 @@
          }
          catch (Throwable e)
          {
-            // TODO why we cannot throw an exception???
+            // TODO why we cannot throw an exception??? (throws Exception expected)
             LOG.error("Error of transaction " + tx + " rollback.", e);
          }
       }



More information about the exo-jcr-commits mailing list