[exo-jcr-commits] exo-jcr SVN: r1285 - in jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test: resources/conf/standalone and 1 other directory.

do-not-reply at jboss.org do-not-reply at jboss.org
Tue Jan 5 04:45:58 EST 2010


Author: nfilotto
Date: 2010-01-05 04:45:57 -0500 (Tue, 05 Jan 2010)
New Revision: 1285

Added:
   jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/jdbc/SQLBenchmarkTest.java
   jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/resources/conf/standalone/sql-benchmark-configuration.xml
   jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/resources/conf/standalone/sql-benchmark-jcr-config.xml
Log:
EXOJCR-302: SQL Benchmark added to compare the old and the new strategy

Added: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/jdbc/SQLBenchmarkTest.java
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/jdbc/SQLBenchmarkTest.java	                        (rev 0)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/jdbc/SQLBenchmarkTest.java	2010-01-05 09:45:57 UTC (rev 1285)
@@ -0,0 +1,702 @@
+package org.exoplatform.services.jcr.impl.storage.jdbc;
+
+import org.exoplatform.container.StandaloneContainer;
+import org.exoplatform.services.jcr.BaseStandaloneTest;
+import org.exoplatform.services.jcr.RepositoryService;
+import org.exoplatform.services.jcr.core.WorkspaceContainerFacade;
+import org.exoplatform.services.jcr.dataflow.persistent.PersistedNodeData;
+import org.exoplatform.services.jcr.dataflow.persistent.PersistedPropertyData;
+import org.exoplatform.services.jcr.datamodel.IllegalNameException;
+import org.exoplatform.services.jcr.datamodel.ItemData;
+import org.exoplatform.services.jcr.datamodel.NodeData;
+import org.exoplatform.services.jcr.datamodel.PropertyData;
+import org.exoplatform.services.jcr.datamodel.QPath;
+import org.exoplatform.services.jcr.datamodel.QPathEntry;
+import org.exoplatform.services.jcr.datamodel.ValueData;
+import org.exoplatform.services.jcr.impl.Constants;
+import org.exoplatform.services.jcr.impl.core.RepositoryImpl;
+import org.exoplatform.services.jcr.storage.WorkspaceDataContainer;
+import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection;
+
+import java.sql.SQLException;
+import java.util.Arrays;
+import java.util.List;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.atomic.AtomicReference;
+
+import javax.jcr.InvalidItemStateException;
+import javax.jcr.RepositoryException;
+
+/*
+ * Copyright (C) 2003-2009 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * This benchmark only works with mysql with the dump that you can find in src/test/resources/SQLBenchmark/exodb_data.sql.zip
+ * 
+ * 
+ * Created by The eXo Platform SAS
+ * Author : Nicolas Filotto 
+ *          nicolas.filotto at exoplatform.com
+ * 18 nov. 2009  
+ */
+public class SQLBenchmarkTest
+{
+   static
+   {
+      try
+      {
+         Class.forName("com.jdbmonitor.MonitorDriver");
+         System.out.println("Driver Loaded");
+      }
+      catch (ClassNotFoundException e)
+      {
+         e.printStackTrace();
+      }
+
+   }
+
+   /**
+    * @param args
+    */
+   public static void main(String[] args) throws Exception
+   {
+      String containerConf =
+         BaseStandaloneTest.class.getResource("/conf/standalone/sql-benchmark-configuration.xml").toString();
+      String loginConf = BaseStandaloneTest.class.getResource("/login.conf").toString();
+
+      StandaloneContainer.addConfigurationURL(containerConf);
+
+      StandaloneContainer container = StandaloneContainer.getInstance();
+
+      if (System.getProperty("java.security.auth.login.config") == null)
+         System.setProperty("java.security.auth.login.config", loginConf);
+
+      benchmark(1, container);
+      benchmark(10, container);
+      benchmark(20, container);
+      benchmark(50, container);
+   }
+
+   private static void benchmark(int threads, StandaloneContainer container) throws Exception
+   {
+      RepositoryService repositoryService =
+         (RepositoryService)container.getComponentInstanceOfType(RepositoryService.class);
+      RepositoryImpl repository1 = (RepositoryImpl)repositoryService.getRepository("repository1");
+      WorkspaceContainerFacade wsc1 = repository1.getWorkspaceContainer("collaboration");
+      final WorkspaceDataContainer dataContainer1 =
+         (WorkspaceDataContainer)wsc1.getComponent(WorkspaceDataContainer.class);
+      WorkspaceContainerFacade wsc1s = repository1.getWorkspaceContainer("system");
+      final WorkspaceDataContainer dataContainer1s =
+         (WorkspaceDataContainer)wsc1s.getComponent(WorkspaceDataContainer.class);
+      RepositoryImpl repository2 = (RepositoryImpl)repositoryService.getRepository("repository2");
+      WorkspaceContainerFacade wsc2 = repository2.getWorkspaceContainer("collaboration");
+      final WorkspaceDataContainer dataContainer2 =
+         (WorkspaceDataContainer)wsc2.getComponent(WorkspaceDataContainer.class);
+      WorkspaceContainerFacade wsc2s = repository2.getWorkspaceContainer("system");
+      final WorkspaceDataContainer dataContainer2s =
+         (WorkspaceDataContainer)wsc2s.getComponent(WorkspaceDataContainer.class);
+
+      System.out.println("########################################");
+
+      int totalTimes;
+      long time;
+      NodeData parent;
+
+      totalTimes = 5000 / threads;
+      QPath path1 = null;
+      Task<QPath> traverseQPath = new Task<QPath>()
+      {
+         public QPath execute(Object... args) throws Exception
+         {
+            return traverseQPath((WorkspaceDataContainer)args[0], (String)args[1]);
+         }
+
+      };
+      Result<QPath> rTraverseQPath =
+         executeTask(traverseQPath, totalTimes, threads, dataContainer1, Constants.ROOT_UUID);
+      path1 = rTraverseQPath.getResult();
+      time = rTraverseQPath.getTime();
+      System.out.println("traverseQPath with deep 0, thread " + threads
+         + ": Total time with the old strategy (n queries) = " + time + ", avg = " + (time / (threads * totalTimes)));
+      QPath path2 = null;
+      rTraverseQPath = executeTask(traverseQPath, totalTimes, threads, dataContainer2, Constants.ROOT_UUID);
+      path2 = rTraverseQPath.getResult();
+      time = rTraverseQPath.getTime();
+      System.out.println("traverseQPath with deep 0, thread " + threads + ": Total time with the new strategy 0 = "
+         + time + ", avg = " + (time / (threads * totalTimes)));
+      System.out.println("path1 == path2 = " + equals(path1, path2));
+
+      rTraverseQPath =
+         executeTask(traverseQPath, totalTimes, threads, dataContainer1, "dfcbd34bc0a8010b006357806c7f108d");
+      path1 = rTraverseQPath.getResult();
+      time = rTraverseQPath.getTime();
+      System.out.println("traverseQPath with deep 1, thread " + threads
+         + ": Total time with the old strategy (n queries) = " + time + ", avg = " + (time / (threads * totalTimes)));
+
+      rTraverseQPath =
+         executeTask(traverseQPath, totalTimes, threads, dataContainer2, "dfcbd34bc0a8010b006357806c7f108d");
+      path2 = rTraverseQPath.getResult();
+      time = rTraverseQPath.getTime();
+      System.out.println("traverseQPath with deep 1, thread " + threads
+         + ": Total time with the new strategy (n/2 queries) = " + time + ", avg = " + (time / (threads * totalTimes)));
+      System.out.println("path1 == path2 = " + equals(path1, path2));
+
+      rTraverseQPath =
+         executeTask(traverseQPath, totalTimes, threads, dataContainer1, "dfcbe240c0a8010b00ff024d54e46b9f");
+      path1 = rTraverseQPath.getResult();
+      time = rTraverseQPath.getTime();
+      System.out.println("traverseQPath with deep 2, thread " + threads
+         + ": Total time with the old strategy (n queries) = " + time + ", avg = " + (time / (threads * totalTimes)));
+
+      rTraverseQPath =
+         executeTask(traverseQPath, totalTimes, threads, dataContainer2, "dfcbe240c0a8010b00ff024d54e46b9f");
+      path2 = rTraverseQPath.getResult();
+      time = rTraverseQPath.getTime();
+      System.out.println("traverseQPath with deep 2, thread " + threads
+         + ": Total time with the new strategy (n/2 queries) = " + time + ", avg = " + (time / (threads * totalTimes)));
+      System.out.println("path1 == path2 = " + equals(path1, path2));
+
+      rTraverseQPath =
+         executeTask(traverseQPath, totalTimes, threads, dataContainer1, "dfcbffaec0a8010b00ed7dad7cb43540");
+      path1 = rTraverseQPath.getResult();
+      time = rTraverseQPath.getTime();
+      System.out.println("traverseQPath with deep 5, thread " + threads
+         + ": Total time with the old strategy (n queries) = " + time + ", avg = " + (time / (threads * totalTimes)));
+
+      rTraverseQPath =
+         executeTask(traverseQPath, totalTimes, threads, dataContainer2, "dfcbffaec0a8010b00ed7dad7cb43540");
+      path2 = rTraverseQPath.getResult();
+      time = rTraverseQPath.getTime();
+      System.out.println("traverseQPath with deep 5, thread " + threads
+         + ": Total time with the new strategy (n/2 queries) = " + time + ", avg = " + (time / (threads * totalTimes)));
+      System.out.println("path1 == path2 = " + equals(path1, path2));
+
+      rTraverseQPath =
+         executeTask(traverseQPath, totalTimes, threads, dataContainer1, "83cb7ebeac1b00a400bf3596e43c8f18");
+      path1 = rTraverseQPath.getResult();
+      time = rTraverseQPath.getTime();
+      System.out.println("traverseQPath with deep 9, thread " + threads
+         + ": Total time with the old strategy (n queries) = " + time + ", avg = " + (time / (threads * totalTimes)));
+
+      rTraverseQPath =
+         executeTask(traverseQPath, totalTimes, threads, dataContainer2, "83cb7ebeac1b00a400bf3596e43c8f18");
+      path2 = rTraverseQPath.getResult();
+      time = rTraverseQPath.getTime();
+      System.out.println("traverseQPath with deep 9, thread " + threads
+         + ": Total time with the new strategy (n/2 queries) = " + time + ", avg = " + (time / (threads * totalTimes)));
+      System.out.println("path1 == path2 = " + equals(path1, path2));
+
+      totalTimes = 1;
+      parent =
+         new PersistedNodeData("83cb2a36ac1b00a400bdbe4f3f4f6e0e", Constants.ROOT_PATH, null, 0, 0, null, null, null);
+
+      Task<List<NodeData>> getChildNodesData = new Task<List<NodeData>>()
+      {
+         public List<NodeData> execute(Object... args) throws Exception
+         {
+            return getChildNodesData((WorkspaceDataContainer)args[0], (NodeData)args[1]);
+         }
+
+      };
+      List<NodeData> nodesData1 = null;
+
+      Result<List<NodeData>> rGetChildNodesData =
+         executeTask(getChildNodesData, totalTimes, threads, dataContainer1, parent);
+      nodesData1 = rGetChildNodesData.getResult();
+      time = rGetChildNodesData.getTime();
+      System.out.println("getChildNodesData with 1034 subnodes, thread " + threads
+         + ": Total time with the old strategy (4*n + 1 queries) = " + time + ", avg = "
+         + (time / (threads * totalTimes)));
+      List<NodeData> nodesData2 = null;
+      rGetChildNodesData = executeTask(getChildNodesData, totalTimes, threads, dataContainer2, parent);
+      nodesData2 = rGetChildNodesData.getResult();
+      time = rGetChildNodesData.getTime();
+      System.out.println("getChildNodesData with 1034 subnodes, thread " + threads
+         + ": Total time with the new strategy (1 query) = " + time + ", avg = " + (time / (threads * totalTimes)));
+      try
+      {
+         System.out.println("length = " + nodesData1.size());
+         System.out.println("nodesData1 == nodesData2 = " + equals(nodesData1, nodesData2) + " length = "
+            + nodesData1.size());
+      }
+      catch (Exception e)
+      {
+         e.printStackTrace();
+      }
+      totalTimes = 100 / threads;
+      parent =
+         new PersistedNodeData("83c6e36cac1b00a400688aeb844539b2", Constants.ROOT_PATH, null, 0, 0, null, null, null);
+      rGetChildNodesData = executeTask(getChildNodesData, totalTimes, threads, dataContainer1, parent);
+      nodesData1 = rGetChildNodesData.getResult();
+      time = rGetChildNodesData.getTime();
+      System.out.println("getChildNodesData with 4 subnodes, thread " + threads
+         + ": Total time with the old strategy (4*n + 1 queries) = " + time + ", avg = "
+         + (time / (threads * totalTimes)));
+
+      rGetChildNodesData = executeTask(getChildNodesData, totalTimes, threads, dataContainer2, parent);
+      nodesData2 = rGetChildNodesData.getResult();
+      time = rGetChildNodesData.getTime();
+      System.out.println("getChildNodesData with 4 subnodes, thread " + threads
+         + ": Total time with the new strategy (1 query) = " + time + ", avg = " + (time / (threads * totalTimes)));
+      System.out.println("nodesData1 == nodesData2 = " + equals(nodesData1, nodesData2) + " length = "
+         + nodesData1.size());
+
+      totalTimes = 1000 / threads;
+
+      Task<ItemData> getItemData = new Task<ItemData>()
+      {
+         public ItemData execute(Object... args) throws Exception
+         {
+            return getItemData((WorkspaceDataContainer)args[0], (String)args[1]);
+         }
+
+      };
+      PersistedNodeData nodeData1 = null;
+      Result<ItemData> rGetItemData =
+         executeTask(getItemData, totalTimes, threads, dataContainer1, "83c6e36cac1b00a400688aeb844539b2");
+      nodeData1 = (PersistedNodeData)rGetItemData.getResult();
+      time = rGetItemData.getTime();
+      System.out.println("getItemData by Id for a node, thread " + threads
+         + ": Total time with the old strategy (5 queries) = " + time + ", avg = " + (time / (threads * totalTimes)));
+
+      PersistedNodeData nodeData2 = null;
+      rGetItemData = executeTask(getItemData, totalTimes, threads, dataContainer2, "83c6e36cac1b00a400688aeb844539b2");
+      nodeData2 = (PersistedNodeData)rGetItemData.getResult();
+      time = rGetItemData.getTime();
+      System.out.println("getItemData by Id for a node, thread " + threads
+         + ": Total time with the new strategy (2 queries) = " + time + ", avg = " + (time / (threads * totalTimes)));
+      System.out.println("nodeData1 == nodeData2 = " + equals(nodeData1, nodeData2));
+
+      PersistedPropertyData propertyData1 = null;
+      rGetItemData = executeTask(getItemData, totalTimes, threads, dataContainer1, "83c6e36cac1b00a40038e9e950ecff39");
+      propertyData1 = (PersistedPropertyData)rGetItemData.getResult();
+      time = rGetItemData.getTime();
+      System.out.println("getItemData by Id for a property, thread " + threads
+         + ": Total time with the old strategy (2 queries) = " + time + ", avg = " + (time / (threads * totalTimes)));
+
+      PersistedPropertyData propertyData2 = null;
+      rGetItemData = executeTask(getItemData, totalTimes, threads, dataContainer2, "83c6e36cac1b00a40038e9e950ecff39");
+      propertyData2 = (PersistedPropertyData)rGetItemData.getResult();
+      time = rGetItemData.getTime();
+      System.out.println("getItemData by Id for a property, thread " + threads
+         + ": Total time with the new strategy (2 queries) (=old strategy) = " + time + ", avg = "
+         + (time / (threads * totalTimes)));
+      System.out.println("propertyData1 == propertyData2 = " + equals(propertyData1, propertyData2));
+
+      NodeData parent2 =
+         new PersistedNodeData("00exo0jcr0root0uuid0000000000000", Constants.ROOT_PATH, null, 0, 0, null, null, null);
+      QPathEntry name2 = new QPathEntry(null, "Documents", 1);
+
+      Task<ItemData> getItemData2 = new Task<ItemData>()
+      {
+         public ItemData execute(Object... args) throws Exception
+         {
+            return getItemData((WorkspaceDataContainer)args[0], (NodeData)args[1], (QPathEntry)args[2]);
+         }
+
+      };
+      rGetItemData = executeTask(getItemData2, totalTimes, threads, dataContainer1, parent2, name2);
+      nodeData1 = (PersistedNodeData)rGetItemData.getResult();
+      time = rGetItemData.getTime();
+      System.out.println("getItemData by QPathEntry for a node, thread " + threads
+         + ": Total time with the old strategy = " + time + ", avg = " + (time / (threads * totalTimes)));
+
+      rGetItemData = executeTask(getItemData2, totalTimes, threads, dataContainer2, parent2, name2);
+      nodeData2 = (PersistedNodeData)rGetItemData.getResult();
+      time = rGetItemData.getTime();
+      System.out.println("getItemData by QPathEntry for a node, thread " + threads
+         + ": Total time with the new strategy = " + time + ", avg = " + (time / (threads * totalTimes)));
+      System.out.println("nodeData1 == nodeData2 = " + equals(nodeData1, nodeData2));
+
+      NodeData parent3 = nodeData1;
+      QPathEntry name3 = new QPathEntry("http://www.exoplatform.com/jcr/exo/1.0", "permissions", 1);
+
+      rGetItemData = executeTask(getItemData2, totalTimes, threads, dataContainer1, parent3, name3);
+      propertyData1 = (PersistedPropertyData)rGetItemData.getResult();
+      time = rGetItemData.getTime();
+      System.out.println("getItemData by QPathEntry for a property, thread " + threads
+         + ": Total time with the old strategy = " + time + ", avg = " + (time / (threads * totalTimes)));
+
+      rGetItemData = executeTask(getItemData2, totalTimes, threads, dataContainer2, parent3, name3);
+      propertyData2 = (PersistedPropertyData)rGetItemData.getResult();
+      time = rGetItemData.getTime();
+      System.out.println("getItemData by QPathEntry for a property, thread " + threads
+         + ": Total time with the new strategy = " + time + ", avg = " + (time / (threads * totalTimes)));
+      System.out.println("propertyData1 == propertyData2 = " + equals(propertyData1, propertyData2));
+
+      parent =
+         new PersistedNodeData("83c7507eac1b00a400cf6d951b948e23", Constants.ROOT_PATH, null, 0, 0, null, null, null);
+
+      totalTimes = 100 / threads;
+      Task<List<PropertyData>> getChildPropertiesData = new Task<List<PropertyData>>()
+      {
+         public List<PropertyData> execute(Object... args) throws Exception
+         {
+            return getChildPropertiesData((WorkspaceDataContainer)args[0], (NodeData)args[1]);
+         }
+
+      };
+      List<PropertyData> propertiesData1 = null;
+      Result<List<PropertyData>> rGetChildPropertiesData =
+         executeTask(getChildPropertiesData, totalTimes, threads, dataContainer1, parent);
+      propertiesData1 = rGetChildPropertiesData.getResult();
+      time = rGetChildPropertiesData.getTime();
+      System.out.println("getChildPropertiesData with 20 properties, thread " + threads
+         + ": Total time with the old strategy (n + 1 queries) = " + time + ", avg = "
+         + (time / (threads * totalTimes)));
+      List<PropertyData> propertiesData2 = null;
+      rGetChildPropertiesData = executeTask(getChildPropertiesData, totalTimes, threads, dataContainer2, parent);
+      propertiesData2 = rGetChildPropertiesData.getResult();
+      time = rGetChildPropertiesData.getTime();
+      System.out.println("getChildPropertiesData with 20 properties, thread " + threads
+         + ": Total time with the new strategy (1 query) = " + time + ", avg = " + (time / (threads * totalTimes)));
+      try
+      {
+         System.out.println("propertiesData1 == propertiesData2 = " + equalsP(propertiesData1, propertiesData2)
+            + " length = " + propertiesData1.size());
+      }
+      catch (Exception e)
+      {
+         e.printStackTrace();
+      }
+      totalTimes = 100 / threads;
+      parent =
+         new PersistedNodeData("83c6e36cac1b00a400688aeb844539b2", Constants.ROOT_PATH, null, 0, 0, null, null, null);
+      rGetChildPropertiesData = executeTask(getChildPropertiesData, totalTimes, threads, dataContainer1, parent);
+      propertiesData1 = rGetChildPropertiesData.getResult();
+      time = rGetChildPropertiesData.getTime();
+      System.out.println("getChildPropertiesData with 6 properties, thread " + threads
+         + ": Total time with the old strategy (n + 1 queries) = " + time + ", avg = "
+         + (time / (threads * totalTimes)));
+
+      rGetChildPropertiesData = executeTask(getChildPropertiesData, totalTimes, threads, dataContainer2, parent);
+      propertiesData2 = rGetChildPropertiesData.getResult();
+      time = rGetChildPropertiesData.getTime();
+      System.out.println("getChildPropertiesData with 6 properties, thread " + threads
+         + ": Total time with the new strategy (1 query) = " + time + ", avg = " + (time / (threads * totalTimes)));
+      System.out.println("propertiesData1 == propertiesData2 = " + equalsP(propertiesData1, propertiesData2)
+         + " length = " + propertiesData1.size());
+
+      totalTimes = 100 / threads;
+      Task<List<PropertyData>> getReferencesData = new Task<List<PropertyData>>()
+      {
+         public List<PropertyData> execute(Object... args) throws Exception
+         {
+            return getReferencesData((WorkspaceDataContainer)args[0], (String)args[1]);
+         }
+
+      };
+      Result<List<PropertyData>> rGetReferencesData =
+         executeTask(getReferencesData, totalTimes, threads, dataContainer1s, "dfcbf3cfc0a8010b00a3f5f3b962c76a");
+      propertiesData1 = rGetReferencesData.getResult();
+      time = rGetReferencesData.getTime();
+      System.out.println("getReferencesData with 3 properties, thread " + threads
+         + ": Total time with the old strategy (n + 1 queries) = " + time + ", avg = "
+         + (time / (threads * totalTimes)));
+
+      rGetReferencesData =
+         executeTask(getReferencesData, totalTimes, threads, dataContainer2s, "dfcbf3cfc0a8010b00a3f5f3b962c76a");
+      propertiesData2 = rGetReferencesData.getResult();
+      time = rGetReferencesData.getTime();
+      System.out.println("getReferencesData with 3 properties, thread " + threads
+         + ": Total time with the new strategy (1 query) = " + time + ", avg = " + (time / (threads * totalTimes)));
+      try
+      {
+         System.out.println("propertiesData1 == propertiesData2 = " + equalsP(propertiesData1, propertiesData2)
+            + " length = " + propertiesData1.size());
+      }
+      catch (Exception e)
+      {
+         e.printStackTrace();
+      }
+      totalTimes = 100 / threads;
+      rGetReferencesData =
+         executeTask(getReferencesData, totalTimes, threads, dataContainer1, "dfcbe9d6c0a8010b004ccac41a161c5d");
+      propertiesData1 = rGetReferencesData.getResult();
+      time = rGetReferencesData.getTime();
+      System.out.println("getReferencesData with 1 property, thread " + threads
+         + ": Total time with the old strategy (n + 1 queries) = " + time + ", avg = "
+         + (time / (threads * totalTimes)));
+
+      rGetReferencesData =
+         executeTask(getReferencesData, totalTimes, threads, dataContainer2, "dfcbe9d6c0a8010b004ccac41a161c5d");
+      propertiesData2 = rGetReferencesData.getResult();
+      time = rGetReferencesData.getTime();
+      System.out.println("getReferencesData with 1 property, thread " + threads
+         + ": Total time with the new strategy (1 query) = " + time + ", avg = " + (time / (threads * totalTimes)));
+      System.out.println("propertiesData1 == propertiesData2 = " + equalsP(propertiesData1, propertiesData2)
+         + " length = " + propertiesData1.size());
+   }
+
+   private static boolean equals(PersistedNodeData nodeData1, PersistedNodeData nodeData2)
+   {
+      return nodeData1.getACL().equals(nodeData2.getACL())
+         && nodeData1.getIdentifier().equals(nodeData2.getIdentifier())
+         && Arrays.equals(nodeData1.getMixinTypeNames(), nodeData2.getMixinTypeNames())
+         && nodeData1.getOrderNumber() == nodeData2.getOrderNumber()
+         && nodeData1.getParentIdentifier().equals(nodeData2.getParentIdentifier())
+         && nodeData1.getPersistedVersion() == nodeData2.getPersistedVersion()
+         && nodeData1.getPrimaryTypeName().equals(nodeData2.getPrimaryTypeName())
+         && nodeData1.getQPath().equals(nodeData2.getQPath()) && nodeData1.isNode() == nodeData2.isNode();
+   }
+
+   private static boolean equals(PersistedPropertyData propertyData1, PersistedPropertyData propertyData2)
+   {
+      boolean result =
+         propertyData1.isMultiValued() == propertyData2.isMultiValued()
+            && propertyData1.isNode() == propertyData2.isNode()
+            && propertyData1.getIdentifier().equals(propertyData2.getIdentifier())
+            && propertyData1.getParentIdentifier().equals(propertyData2.getParentIdentifier())
+            && propertyData1.getPersistedVersion() == propertyData2.getPersistedVersion()
+            && propertyData1.getQPath().equals(propertyData2.getQPath())
+            && propertyData1.getType() == propertyData2.getType();
+      if (!result)
+      {
+         return false;
+      }
+      List<ValueData> values1 = propertyData1.getValues();
+      List<ValueData> values2 = propertyData2.getValues();
+      if (values1 == null)
+      {
+         return values2 == null;
+      }
+      else if (values2 == null || values1.size() != values2.size())
+      {
+         return false;
+      }
+      else
+      {
+         for (int i = 0; i < values1.size(); i++)
+         {
+            ValueData value1 = values1.get(i);
+            ValueData value2 = values2.get(i);
+            result =
+               value1.isByteArray() == value2.isByteArray() && value1.getLength() == value2.getLength()
+                  && value1.getOrderNumber() == value2.getOrderNumber();
+            if (!result)
+            {
+               return false;
+            }
+         }
+      }
+      return true;
+   }
+
+   private static boolean equals(QPath path1, QPath path2)
+   {
+      return path1.equals(path2);
+   }
+
+   private static boolean equalsP(List<PropertyData> propertiesData1, List<PropertyData> propertiesData2)
+   {
+      if (propertiesData1 == null)
+      {
+         return propertiesData2 == null;
+      }
+      else if (propertiesData2 == null || propertiesData1.size() != propertiesData2.size())
+      {
+         return false;
+      }
+      else
+      {
+         for (int i = 0; i < propertiesData1.size(); i++)
+         {
+            PersistedPropertyData propertyData1 = (PersistedPropertyData)propertiesData1.get(i);
+            PersistedPropertyData propertyData2 = (PersistedPropertyData)propertiesData2.get(i);
+            if (!equals(propertyData1, propertyData2))
+            {
+               return false;
+            }
+         }
+      }
+      return true;
+   }
+
+   private static boolean equals(List<NodeData> nodesData1, List<NodeData> nodesData2)
+   {
+      if (nodesData1 == null)
+      {
+         return nodesData2 == null;
+      }
+      else if (nodesData2 == null || nodesData1.size() != nodesData2.size())
+      {
+         return false;
+      }
+      else
+      {
+         for (int i = 0; i < nodesData1.size(); i++)
+         {
+            PersistedNodeData nodeData1 = (PersistedNodeData)nodesData1.get(i);
+            PersistedNodeData nodeData2 = (PersistedNodeData)nodesData2.get(i);
+            if (!equals(nodeData1, nodeData2))
+            {
+               return false;
+            }
+         }
+      }
+      return true;
+   }
+
+   public static ItemData getItemData(WorkspaceDataContainer dataContainer, NodeData parentData, QPathEntry name)
+      throws RepositoryException, IllegalStateException
+   {
+      final WorkspaceStorageConnection con = dataContainer.openConnection();
+      try
+      {
+         return con.getItemData(parentData, name);
+      }
+      finally
+      {
+         con.close();
+      }
+   }
+
+   private static ItemData getItemData(WorkspaceDataContainer dataContainer, final String identifier)
+      throws RepositoryException
+   {
+      final WorkspaceStorageConnection con = dataContainer.openConnection();
+      try
+      {
+         return con.getItemData(identifier);
+      }
+      finally
+      {
+         con.close();
+      }
+   }
+
+   private static List<NodeData> getChildNodesData(WorkspaceDataContainer dataContainer, final NodeData parent)
+      throws RepositoryException
+   {
+      final WorkspaceStorageConnection con = dataContainer.openConnection();
+      try
+      {
+         return con.getChildNodesData(parent);
+      }
+      finally
+      {
+         con.close();
+      }
+   }
+
+   private static List<PropertyData> getChildPropertiesData(WorkspaceDataContainer dataContainer, final NodeData parent)
+      throws RepositoryException
+   {
+      final WorkspaceStorageConnection con = dataContainer.openConnection();
+      try
+      {
+         return con.getChildPropertiesData(parent);
+      }
+      finally
+      {
+         con.close();
+      }
+   }
+
+   private static List<PropertyData> getReferencesData(WorkspaceDataContainer dataContainer, final String identifier)
+      throws RepositoryException
+   {
+      final WorkspaceStorageConnection con = dataContainer.openConnection();
+      try
+      {
+         return con.getReferencesData(identifier);
+      }
+      finally
+      {
+         con.close();
+      }
+   }
+
+   private static QPath traverseQPath(WorkspaceDataContainer dataContainer, final String identifier)
+      throws RepositoryException, SQLException, InvalidItemStateException, IllegalNameException
+   {
+      final JDBCStorageConnection con = (JDBCStorageConnection)dataContainer.openConnection();
+      try
+      {
+         return con.traverseQPath(con.getInternalId(identifier));
+      }
+      finally
+      {
+         con.close();
+      }
+   }
+
+   private static interface Task<R>
+   {
+      R execute(Object... args) throws Exception;
+   }
+
+   private static class Result<R>
+   {
+      private final R result;
+
+      private final long time;
+
+      public Result(R result, long time)
+      {
+         this.result = result;
+         this.time = time;
+      }
+
+      public R getResult()
+      {
+         return result;
+      }
+
+      public long getTime()
+      {
+         return time;
+      }
+   }
+
+   private static <R> Result<R> executeTask(final Task<R> task, final int totalTimes, int threads, final Object... args)
+      throws InterruptedException
+   {
+      final CountDownLatch startSignal = new CountDownLatch(1);
+      final CountDownLatch doneSignal = new CountDownLatch(threads);
+      final AtomicReference<R> result = new AtomicReference<R>();
+      for (int i = 0; i < threads; i++)
+      {
+         Thread t = new Thread()
+         {
+            public void run()
+            {
+               try
+               {
+                  for (int i = 0; i < totalTimes; i++)
+                  {
+                     result.set(task.execute(args));
+                  }
+               }
+               catch (Exception e)
+               {
+                  e.printStackTrace();
+               }
+               finally
+               {
+                  doneSignal.countDown();
+               }
+            }
+         };
+         t.start();
+      }
+      long time = System.currentTimeMillis();
+      startSignal.countDown();
+      doneSignal.await();
+      return new Result<R>(result.get(), System.currentTimeMillis() - time);
+   }
+}

Added: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/resources/conf/standalone/sql-benchmark-configuration.xml
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/resources/conf/standalone/sql-benchmark-configuration.xml	                        (rev 0)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/resources/conf/standalone/sql-benchmark-configuration.xml	2010-01-05 09:45:57 UTC (rev 1285)
@@ -0,0 +1,198 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+    Copyright (C) 2009 eXo Platform SAS.
+
+    This is free software; you can redistribute it and/or modify it
+    under the terms of the GNU Lesser General Public License as
+    published by the Free Software Foundation; either version 2.1 of
+    the License, or (at your option) any later version.
+
+    This software is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this software; if not, write to the Free
+    Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+    02110-1301 USA, or see the FSF site: http://www.fsf.org.
+
+-->
+<configuration
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
+   xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
+  <component>
+    <key>org.exoplatform.services.log.LogConfigurationInitializer</key>
+    <type>org.exoplatform.services.log.LogConfigurationInitializer</type>
+    <init-params>
+      <value-param>
+        <name>logger</name>
+        <value>org.exoplatform.services.log.impl.BufferedLog4JLogger</value>
+      </value-param>
+      <value-param>
+        <name>configurator</name>
+        <value>org.exoplatform.services.log.impl.Log4JConfigurator</value>
+      </value-param>
+      <properties-param>
+        <name>properties</name>
+        <description>Log4J properties</description>
+        <property name="log4j.rootLogger" value="INFO, stdout, file"/>
+        
+        <property name="log4j.appender.stdout" value="org.apache.log4j.ConsoleAppender"/>
+        <property name="log4j.appender.stdout.threshold" value="DEBUG"/>
+        
+        <property name="log4j.appender.stdout.layout" value="org.apache.log4j.PatternLayout"/>
+        <property name="log4j.appender.stdout.layout.ConversionPattern"
+          value="%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L) %n"/>
+        
+        <property name="log4j.appender.file" value="org.apache.log4j.FileAppender"/>
+        <property name="log4j.appender.file.File" value="target/jcr.log"/>
+        
+        <property name="log4j.appender.file.layout" value="org.apache.log4j.PatternLayout"/>
+        <property name="log4j.appender.file.layout.ConversionPattern"
+          value="%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L) %n"/>
+        
+        <property name="log4j.category.jcr.FileCleaner" value="DEBUG"/>
+        
+        <!-- property name="log4j.category.jcr.JDBCStorageConnection" value="DEBUG"/>
+        <property name="log4j.category.jcr.NodeImpl" value="DEBUG"/ -->
+        
+        <!-- property name="log4j.category.jcr.WorkspaceStorageCacheImpl" value="DEBUG"/ -->
+        <!-- property name="log4j.category.database.DBSchemaCreator" value="DEBUG"/ -->
+        <!-- property name="log4j.category.jcr.WorkspaceDataReplicator" value="DEBUG"/ -->
+        
+        <!-- property name="log4j.category.jcr.WorkspaceStorageCacheImpl" value="DEBUG"/ -->
+        <!-- property name="log4j.category.jcr.WorkspacePersistentDataManager" value="DEBUG"/ -->
+        <!-- property name="log4j.category.jcr.SessionDataManager" value="DEBUG"/ -->
+      </properties-param>
+      
+      <!-- value-param>
+      <name>logger</name>
+      <value>org.exoplatform.services.log.impl.BufferedSimpleLog</value>
+      </value-param>
+      <value-param>
+      <name>configurator</name>
+      <value>org.exoplatform.services.log.impl.SimpleLogConfigurator</value>
+      </value-param>
+      <properties-param>
+      <name>properties</name>
+      <description>SimpleLog properties</description>
+      <property name="org.apache.commons.logging.simplelog.defaultlog" value="debug"/>
+      <property name="org.apache.commons.logging.simplelog.showdatetime" value="true"/>
+      </properties-param -->
+      
+      <!-- value-param>
+      <name>logger</name>
+      <value>org.exoplatform.services.log.impl.BufferedJdk14Logger</value>
+      </value-param>
+      <value-param>
+      <name>configurator</name>
+      <value>org.exoplatform.services.log.impl.Jdk14Configurator</value>
+      </value-param>
+      <properties-param>
+      <name>properties</name>
+      <description>jdk1.4 Logger properties</description>
+      <property name="handlers" value="java.util.logging.ConsoleHandler"/>
+      <property name=".level" value="FINE"/>
+      <property name="java.util.logging.ConsoleHandler.level" value="FINE"/>
+      </properties-param -->
+      
+    </init-params>
+  </component>
+
+  <component>
+    <key>org.exoplatform.services.jcr.RepositoryService</key>
+    <type>org.exoplatform.services.jcr.impl.RepositoryServiceImpl</type>
+    <component-plugins>
+      <component-plugin>
+        <name>add.namespaces</name>
+        <set-method>addPlugin</set-method>
+        <type>org.exoplatform.services.jcr.impl.AddNamespacesPlugin</type>
+        <init-params>
+          <properties-param>
+            <name>namespaces</name>
+            <property name="test" value="http://www.apache.org/jackrabbit/test"/>
+            <property name="exojcrtest" value="http://www.exoplatform.org/jcr/test/1.0"/>
+            <property name="rma" value="http://www.rma.com/jcr/"/>
+            <property name="metadata" value="http://www.exoplatform.com/jcr/metadata/1.1/"/>
+            <property name="dc" value="http://purl.org/dc/elements/1.1/"/>
+          </properties-param>
+        </init-params>
+      </component-plugin>
+    </component-plugins>
+  </component>
+  
+  <component>
+    <key>org.exoplatform.services.jcr.config.RepositoryServiceConfiguration</key>
+    <type>org.exoplatform.services.jcr.impl.config.RepositoryServiceConfigurationImpl</type>
+    <init-params>
+      <value-param>
+        <name>conf-path</name>
+        <description>JCR configuration file</description>
+        <value>jar:/conf/standalone/sql-benchmark-jcr-config.xml</value>
+      </value-param>
+    </init-params>
+  </component>
+  
+  <component>
+    <type>org.exoplatform.services.organization.impl.mock.DummyOrganizationService</type>
+  </component>
+  
+  <component>
+    <key>org.exoplatform.services.security.Authenticator</key>
+    <type>org.exoplatform.services.organization.auth.OrganizationAuthenticatorImpl</type>
+  </component>
+  
+  <component>
+    <type>org.exoplatform.services.jcr.impl.ext.action.SessionActionCatalog</type>
+  </component>
+  
+  <component>
+    <key>org.exoplatform.services.transaction.TransactionService</key>
+    <type>org.exoplatform.services.transaction.impl.jotm.TransactionServiceJotmImpl</type>
+    <init-params>
+      <value-param>
+        <name>timeout</name>
+        <value>5</value>
+      </value-param>
+    </init-params>
+  </component>
+  
+  <external-component-plugins>
+    <target-component>org.exoplatform.services.naming.InitialContextInitializer</target-component>
+    <component-plugin>
+      <name>bind.datasource</name>
+      <set-method>addPlugin</set-method>
+      <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+      <init-params>
+        <value-param>
+          <name>bind-name</name>
+          <value>jdbcexo</value>
+        </value-param>
+        <value-param>
+          <name>class-name</name>
+          <value>javax.sql.DataSource</value>
+        </value-param>
+        <value-param>
+          <name>factory</name>
+          <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+        </value-param>
+        <properties-param>
+          <name>ref-addresses</name>
+          <description>ref-addresses</description>
+          <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
+          <property name="url" value="jdbc:mysql://localhost:3306/exodb?relaxAutoCommit=true&amp;autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=utf8"/>
+          <property name="username" value="root"/>
+          <property name="password" value="root"/>
+          <property name="maxActive" value="50" />
+          <property name="maxIdle" value="5" />
+          <property name="initialSize" value="50" />                  
+        </properties-param>
+      </init-params>
+    </component-plugin>
+  </external-component-plugins>
+  
+  <remove-configuration>org.exoplatform.services.scheduler.JobSchedulerService</remove-configuration>
+</configuration>

Added: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/resources/conf/standalone/sql-benchmark-jcr-config.xml
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/resources/conf/standalone/sql-benchmark-jcr-config.xml	                        (rev 0)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/resources/conf/standalone/sql-benchmark-jcr-config.xml	2010-01-05 09:45:57 UTC (rev 1285)
@@ -0,0 +1,474 @@
+<repository-service default-repository="repository">
+	<repositories>
+		<repository name="repository1" system-workspace="system"
+			default-workspace="collaboration">
+			<security-domain>exo-domain</security-domain>
+			<access-control>optional</access-control>
+			<authentication-policy>org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator</authentication-policy>
+			<workspaces>
+				<workspace name="system">
+					<container
+						class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
+						<properties>
+							<property name="source-name" value="jdbcexo" />
+							<property name="dialect" value="MySQL" />
+							<!--<property name="dialect" value="hsqldb"/>-->
+							<property name="multi-db" value="false" />
+							<property name="max-buffer-size" value="200k" />
+							<property name="swap-directory" value="../temp/swap/system" />
+						</properties>
+						<value-storages>
+							<value-storage id="system"
+								class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+								<properties>
+									<property name="path" value="../temp/values/system" />
+								</properties>
+								<filters>
+									<filter property-type="Binary" />
+								</filters>
+							</value-storage>
+						</value-storages>
+					</container>
+					<initializer
+						class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+						<properties>
+							<property name="root-nodetype" value="nt:unstructured" />
+							<property name="root-permissions"
+								value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
+						</properties>
+					</initializer>
+					<cache enabled="true"
+						class="org.exoplatform.services.jcr.impl.dataflow.persistent.LinkedWorkspaceStorageCacheImpl">
+						<properties>
+							<property name="max-size" value="20k" />
+							<property name="live-time" value="1h" />
+						</properties>
+					</cache>
+<!--					<query-handler-->
+<!--						class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">-->
+<!--						<properties>-->
+<!--							<property name="index-dir" value="../temp/jcrlucenedb/system" />-->
+<!--							<property name="support-highlighting" value="true" />-->
+<!--							<property name="excerptprovider-class"-->
+<!--								value="org.exoplatform.services.jcr.impl.core.query.lucene.DefaultHTMLExcerpt" />-->
+<!--						</properties>-->
+<!--					</query-handler>-->
+					<lock-manager>
+						<time-out>15m</time-out>
+						<persister
+							class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
+							<properties>
+								<property name="path" value="../temp/lock/system" />
+							</properties>
+						</persister>
+					</lock-manager>
+				</workspace>
+				<workspace name="collaboration">
+					<container
+						class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
+						<properties>
+							<property name="source-name" value="jdbcexo" />
+							<property name="dialect" value="MySQL" />
+							<!--<property name="dialect" value="hsqldb"/> -->
+							<property name="multi-db" value="false" />
+							<property name="max-buffer-size" value="200k" />
+							<property name="swap-directory" value="../temp/swap/collaboration" />
+						</properties>
+						<value-storages>
+							<value-storage id="collaboration"
+								class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+								<properties>
+									<property name="path" value="../temp/values/collaboration" />
+								</properties>
+								<filters>
+									<filter property-type="Binary" />
+								</filters>
+							</value-storage>
+						</value-storages>
+					</container>
+					<initializer
+						class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+						<properties>
+							<property name="root-nodetype" value="nt:unstructured" />
+							<property name="root-permissions"
+								value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
+						</properties>
+					</initializer>
+					<cache enabled="true"
+						class="org.exoplatform.services.jcr.impl.dataflow.persistent.LinkedWorkspaceStorageCacheImpl">
+						<properties>
+							<property name="max-size" value="20k" />
+							<property name="live-time" value="1h" />
+						</properties>
+					</cache>
+<!--					<query-handler-->
+<!--						class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">-->
+<!--						<properties>-->
+<!--							<property name="index-dir" value="../temp/jcrlucenedb/collaboration" />-->
+<!--							<property name="support-highlighting" value="true" />-->
+<!--							<property name="excerptprovider-class"-->
+<!--								value="org.exoplatform.services.jcr.impl.core.query.lucene.DefaultHTMLExcerpt" />-->
+<!--						</properties>-->
+<!--					</query-handler>-->
+					<lock-manager>
+						<time-out>15m</time-out>
+						<persister
+							class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
+							<properties>
+								<property name="path" value="../temp/lock/collaboration" />
+							</properties>
+						</persister>
+					</lock-manager>
+				</workspace>
+				<workspace name="backup">
+					<container
+						class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
+						<properties>
+							<property name="source-name" value="jdbcexo" />
+							<property name="dialect" value="MySQL" />
+							<!--<property name="dialect" value="hsqldb"/> -->
+							<property name="multi-db" value="false" />
+							<property name="max-buffer-size" value="200k" />
+							<property name="swap-directory" value="../temp/swap/backup" />
+						</properties>
+						<value-storages>
+							<value-storage id="backup"
+								class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+								<properties>
+									<property name="path" value="../temp/values/backup" />
+								</properties>
+								<filters>
+									<filter property-type="Binary" />
+								</filters>
+							</value-storage>
+						</value-storages>
+					</container>
+					<initializer
+						class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+						<properties>
+							<property name="root-nodetype" value="nt:unstructured" />
+							<property name="root-permissions"
+								value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
+						</properties>
+					</initializer>
+					<cache enabled="true"
+						class="org.exoplatform.services.jcr.impl.dataflow.persistent.LinkedWorkspaceStorageCacheImpl">
+						<properties>
+							<property name="max-size" value="5k" />
+							<property name="live-time" value="20m" />
+						</properties>
+					</cache>
+<!--					<query-handler-->
+<!--						class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">-->
+<!--						<properties>-->
+<!--							<property name="index-dir" value="../temp/jcrlucenedb/backup" />-->
+<!--							<property name="support-highlighting" value="true" />-->
+<!--							<property name="excerptprovider-class"-->
+<!--								value="org.exoplatform.services.jcr.impl.core.query.lucene.DefaultHTMLExcerpt" />-->
+<!--						</properties>-->
+<!--					</query-handler>-->
+					<lock-manager>
+						<time-out>15m</time-out>
+						<persister
+							class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
+							<properties>
+								<property name="path" value="../temp/lock/backup" />
+							</properties>
+						</persister>
+					</lock-manager>
+				</workspace>
+				<workspace name="gadgets">
+					<!-- for system storage -->
+					<container
+						class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
+						<properties>
+							<property name="source-name" value="jdbcexo" />
+							<property name="dialect" value="MySQL" />
+							<!--<property name="dialect" value="hsqldb"/> -->
+							<property name="multi-db" value="false" />
+							<property name="update-storage" value="true" />
+							<property name="max-buffer-size" value="200k" />
+							<property name="swap-directory" value="../temp/swap/gadgets" />
+						</properties>
+						<value-storages>
+							<value-storage id="gadgets"
+								class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+								<properties>
+									<property name="path" value="../temp/values/gadgets" />
+								</properties>
+								<filters>
+									<filter property-type="Binary" />
+								</filters>
+							</value-storage>
+						</value-storages>
+					</container>
+					<initializer
+						class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+						<properties>
+							<property name="root-nodetype" value="nt:unstructured" />
+							<property name="root-permissions"
+								value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
+						</properties>
+					</initializer>
+					<cache enabled="true"
+						class="org.exoplatform.services.jcr.impl.dataflow.persistent.LinkedWorkspaceStorageCacheImpl">
+						<properties>
+							<property name="max-size" value="20k" />
+							<property name="live-time" value="1h" />
+						</properties>
+					</cache>
+<!--					<query-handler-->
+<!--						class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">-->
+<!--						<properties>-->
+<!--							<property name="index-dir" value="../temp/jcrlucenedb/gadgets" />-->
+<!--						</properties>-->
+<!--					</query-handler>-->
+					<lock-manager>
+						<time-out>15m</time-out><!-- 15min -->
+						<persister
+							class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
+							<properties>
+								<property name="path" value="../temp/lock/gadgets" />
+							</properties>
+						</persister>
+					</lock-manager>
+				</workspace>
+			</workspaces>
+		</repository>
+		<repository name="repository2" system-workspace="system"
+			default-workspace="collaboration">
+			<security-domain>exo-domain</security-domain>
+			<access-control>optional</access-control>
+			<authentication-policy>org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator</authentication-policy>
+			<workspaces>
+				<workspace name="system">
+					<container
+						class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
+						<properties>
+							<property name="source-name" value="jdbcexo" />
+							<property name="dialect" value="MySQL" />
+							<!--<property name="dialect" value="hsqldb"/>-->
+							<property name="multi-db" value="false" />
+							<property name="max-buffer-size" value="200k" />
+							<property name="swap-directory" value="../temp/swap/system" />
+						</properties>
+						<value-storages>
+							<value-storage id="system"
+								class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+								<properties>
+									<property name="path" value="../temp/values/system" />
+								</properties>
+								<filters>
+									<filter property-type="Binary" />
+								</filters>
+							</value-storage>
+						</value-storages>
+					</container>
+					<initializer
+						class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+						<properties>
+							<property name="root-nodetype" value="nt:unstructured" />
+							<property name="root-permissions"
+								value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
+						</properties>
+					</initializer>
+					<cache enabled="true"
+						class="org.exoplatform.services.jcr.impl.dataflow.persistent.LinkedWorkspaceStorageCacheImpl">
+						<properties>
+							<property name="max-size" value="20k" />
+							<property name="live-time" value="1h" />
+						</properties>
+					</cache>
+<!--					<query-handler-->
+<!--						class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">-->
+<!--						<properties>-->
+<!--							<property name="index-dir" value="../temp/jcrlucenedb/system2" />-->
+<!--							<property name="support-highlighting" value="true" />-->
+<!--							<property name="excerptprovider-class"-->
+<!--								value="org.exoplatform.services.jcr.impl.core.query.lucene.DefaultHTMLExcerpt" />-->
+<!--						</properties>-->
+<!--					</query-handler>-->
+					<lock-manager>
+						<time-out>15m</time-out>
+						<persister
+							class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
+							<properties>
+								<property name="path" value="../temp/lock/system" />
+							</properties>
+						</persister>
+					</lock-manager>
+				</workspace>
+				<workspace name="collaboration">
+					<container
+						class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
+						<properties>
+							<property name="source-name" value="jdbcexo" />
+							<property name="dialect" value="MySQL" />
+							<!--<property name="dialect" value="hsqldb"/> -->
+							<property name="multi-db" value="false" />
+							<property name="max-buffer-size" value="200k" />
+							<property name="swap-directory" value="../temp/swap/collaboration" />
+						</properties>
+						<value-storages>
+							<value-storage id="collaboration"
+								class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+								<properties>
+									<property name="path" value="../temp/values/collaboration" />
+								</properties>
+								<filters>
+									<filter property-type="Binary" />
+								</filters>
+							</value-storage>
+						</value-storages>
+					</container>
+					<initializer
+						class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+						<properties>
+							<property name="root-nodetype" value="nt:unstructured" />
+							<property name="root-permissions"
+								value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
+						</properties>
+					</initializer>
+					<cache enabled="true"
+						class="org.exoplatform.services.jcr.impl.dataflow.persistent.LinkedWorkspaceStorageCacheImpl">
+						<properties>
+							<property name="max-size" value="20k" />
+							<property name="live-time" value="1h" />
+						</properties>
+					</cache>
+<!--					<query-handler-->
+<!--						class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">-->
+<!--						<properties>-->
+<!--							<property name="index-dir" value="../temp/jcrlucenedb/collaboration2" />-->
+<!--							<property name="support-highlighting" value="true" />-->
+<!--							<property name="excerptprovider-class"-->
+<!--								value="org.exoplatform.services.jcr.impl.core.query.lucene.DefaultHTMLExcerpt" />-->
+<!--						</properties>-->
+<!--					</query-handler>-->
+					<lock-manager>
+						<time-out>15m</time-out>
+						<persister
+							class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
+							<properties>
+								<property name="path" value="../temp/lock/collaboration" />
+							</properties>
+						</persister>
+					</lock-manager>
+				</workspace>
+				<workspace name="backup">
+					<container
+						class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
+						<properties>
+							<property name="source-name" value="jdbcexo" />
+							<property name="dialect" value="MySQL" />
+							<!--<property name="dialect" value="hsqldb"/> -->
+							<property name="multi-db" value="false" />
+							<property name="max-buffer-size" value="200k" />
+							<property name="swap-directory" value="../temp/swap/backup" />
+						</properties>
+						<value-storages>
+							<value-storage id="backup"
+								class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+								<properties>
+									<property name="path" value="../temp/values/backup" />
+								</properties>
+								<filters>
+									<filter property-type="Binary" />
+								</filters>
+							</value-storage>
+						</value-storages>
+					</container>
+					<initializer
+						class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+						<properties>
+							<property name="root-nodetype" value="nt:unstructured" />
+							<property name="root-permissions"
+								value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
+						</properties>
+					</initializer>
+					<cache enabled="true"
+						class="org.exoplatform.services.jcr.impl.dataflow.persistent.LinkedWorkspaceStorageCacheImpl">
+						<properties>
+							<property name="max-size" value="5k" />
+							<property name="live-time" value="20m" />
+						</properties>
+					</cache>
+<!--					<query-handler-->
+<!--						class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">-->
+<!--						<properties>-->
+<!--							<property name="index-dir" value="../temp/jcrlucenedb/backup2" />-->
+<!--							<property name="support-highlighting" value="true" />-->
+<!--							<property name="excerptprovider-class"-->
+<!--								value="org.exoplatform.services.jcr.impl.core.query.lucene.DefaultHTMLExcerpt" />-->
+<!--						</properties>-->
+<!--					</query-handler>-->
+					<lock-manager>
+						<time-out>15m</time-out>
+						<persister
+							class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
+							<properties>
+								<property name="path" value="../temp/lock/backup" />
+							</properties>
+						</persister>
+					</lock-manager>
+				</workspace>
+				<workspace name="gadgets">
+					<!-- for system storage -->
+					<container
+						class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
+						<properties>
+							<property name="source-name" value="jdbcexo" />
+							<property name="dialect" value="MySQL" />
+							<!--<property name="dialect" value="hsqldb"/> -->
+							<property name="multi-db" value="false" />
+							<property name="update-storage" value="true" />
+							<property name="max-buffer-size" value="200k" />
+							<property name="swap-directory" value="../temp/swap/gadgets" />
+						</properties>
+						<value-storages>
+							<value-storage id="gadgets"
+								class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+								<properties>
+									<property name="path" value="../temp/values/gadgets" />
+								</properties>
+								<filters>
+									<filter property-type="Binary" />
+								</filters>
+							</value-storage>
+						</value-storages>
+					</container>
+					<initializer
+						class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+						<properties>
+							<property name="root-nodetype" value="nt:unstructured" />
+							<property name="root-permissions"
+								value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
+						</properties>
+					</initializer>
+					<cache enabled="true"
+						class="org.exoplatform.services.jcr.impl.dataflow.persistent.LinkedWorkspaceStorageCacheImpl">
+						<properties>
+							<property name="max-size" value="20k" />
+							<property name="live-time" value="1h" />
+						</properties>
+					</cache>
+<!--					<query-handler-->
+<!--						class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">-->
+<!--						<properties>-->
+<!--							<property name="index-dir" value="../temp/jcrlucenedb/gadgets2" />-->
+<!--						</properties>-->
+<!--					</query-handler>-->
+					<lock-manager>
+						<time-out>15m</time-out><!-- 15min -->
+						<persister
+							class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
+							<properties>
+								<property name="path" value="../temp/lock/gadgets" />
+							</properties>
+						</persister>
+					</lock-manager>
+				</workspace>
+			</workspaces>
+		</repository>		
+	</repositories>
+</repository-service>



More information about the exo-jcr-commits mailing list