[exo-jcr-commits] exo-jcr SVN: r578 - 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 12 03:20:53 EST 2009


Author: areshetnyak
Date: 2009-11-12 03:20:53 -0500 (Thu, 12 Nov 2009)
New Revision: 578

Modified:
   jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java
Log:
EXOJCR-201 : The JDBCCacheLoader was changed.

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-12 08:18:35 UTC (rev 577)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java	2009-11-12 08:20:53 UTC (rev 578)
@@ -275,25 +275,28 @@
             {
                NodeData nodeData = (NodeData) modifications.get(i).getValue();
                itemData = jdbcConnection.getItemData(nodeData.getIdentifier());
+               
+               // Set oldValueData for update node
+               if (itemData != null) 
+                  modifications.get(i).setOldValue(itemData);
             }
             else if (modifications.get(i).getValue() instanceof PropertyData)
             {
                PropertyData propertyData = (PropertyData) modifications.get(i).getValue();
                itemData = jdbcConnection.getItemData(propertyData.getIdentifier());
+               
+               // Set oldValueData for update property
+               if (itemData != null) 
+                  modifications.get(i).setOldValue(itemData);
             } else {
                modifications.set(i, new ModificationEx(modifications.get(i)));
                continue;
             }
-
-            // Set ModificationEx to list with type UPDATE or ADD.
-            if (itemData == null)
-               modifications.set(i, new ModificationEx(modifications.get(i), JCROperaionType.ADD));
-            else
-               modifications.set(i, new ModificationEx(modifications.get(i), JCROperaionType.UPDATE));
          }
-         else
+         else if (modifications.get(i).getType() == ModificationType.REMOVE_KEY_VALUE)
          {
-            modifications.set(i, new ModificationEx(modifications.get(i)));
+            (ItemData)(modifications.get(i).getValue());
+            ItemData removedItemData = jdbcConnection.getItemData(.getIdentifier()));
          }
       }
    }
@@ -361,12 +364,15 @@
                {
                   NodeData parentNodeData = (NodeData) conn.getItemData((String)name.get(1));
                   
-                  if (parentNodeData == null)
-                    throw new JDBCCacheLoaderException("The parent node with ID = " + (String)name.get(2) + " not exis, FQN = '" + name + "'.");
+//                  if (parentNodeData == null)
+//                    throw new JDBCCacheLoaderException("The parent node with ID = " + (String)name.get(1) + " not exis, FQN = '" + name + "'.");
                   
-                  NodeData nodeData = (NodeData) conn.getItemData(parentNodeData, nodeName);
-                  if (nodeData != null)
-                    attrs.put(JBossCacheStorage.ITEM_ID, nodeData.getIdentifier());
+                  if (parentNodeData != null)
+                  {
+                     NodeData nodeData = (NodeData) conn.getItemData(parentNodeData, nodeName);
+                     if (nodeData != null)
+                        attrs.put(JBossCacheStorage.ITEM_ID, nodeData.getIdentifier());
+                  }
                }
                finally
                {



More information about the exo-jcr-commits mailing list