[exo-jcr-commits] exo-jcr SVN: r5841 - in jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc: db and 1 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Mon Mar 12 08:49:33 EDT 2012


Author: tolusha
Date: 2012-03-12 08:49:32 -0400 (Mon, 12 Mar 2012)
New Revision: 5841

Modified:
   jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java
   jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java
   jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java
   jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java
   jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java
Log:
EXOJCR-1762: auto-repair, remove unnecessary query

Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java	2012-03-12 12:45:05 UTC (rev 5840)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java	2012-03-12 12:49:32 UTC (rev 5841)
@@ -2813,12 +2813,6 @@
     */
    protected abstract void deleteLockProperties() throws SQLException;
 
-   /**
-    * Deletes [http://www.jcp.org/jcr/1.0]lockOwner and [http://www.jcp.org/jcr/1.0]lockIsDeep
-    * properties directly from DB for specific parent.
-    */
-   protected abstract void deleteLockProperties(String nodeIdentifier) throws SQLException;
-
    protected abstract ResultSet findReferences(String nodeIdentifier) throws SQLException;
 
    protected abstract int deleteItemByIdentifier(String identifier) throws SQLException;

Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java	2012-03-12 12:45:05 UTC (rev 5840)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java	2012-03-12 12:49:32 UTC (rev 5841)
@@ -609,61 +609,6 @@
    /**
     * {@inheritDoc}
     */
-   protected void deleteLockProperties(String nodeIdentifier) throws SQLException
-   {
-      PreparedStatement removeValuesStatement = null;
-      PreparedStatement removeItemsStatement = null;
-
-      try
-      {
-         removeValuesStatement =
-            dbConnection.prepareStatement("DELETE FROM JCR_MVALUE WHERE PROPERTY_ID IN"
-               + " (SELECT ID FROM JCR_MITEM WHERE PARENT_ID=? AND"
-               + " (NAME = '[http://www.jcp.org/jcr/1.0]lockIsDeep' OR"
-               + " NAME = '[http://www.jcp.org/jcr/1.0]lockOwner'))");
-
-         removeItemsStatement =
-            dbConnection.prepareStatement("DELETE FROM JCR_MITEM WHERE PARENT_ID=? AND"
-               + " (NAME = '[http://www.jcp.org/jcr/1.0]lockIsDeep' OR"
-               + " NAME = '[http://www.jcp.org/jcr/1.0]lockOwner')");
-
-         removeValuesStatement.setString(1, getInternalId(nodeIdentifier));
-         removeItemsStatement.setString(1, getInternalId(nodeIdentifier));
-
-         removeValuesStatement.executeUpdate();
-         removeItemsStatement.executeUpdate();
-      }
-      finally
-      {
-         if (removeValuesStatement != null)
-         {
-            try
-            {
-               removeValuesStatement.close();
-            }
-            catch (SQLException e)
-            {
-               LOG.error("Can't close statement", e);
-            }
-         }
-
-         if (removeItemsStatement != null)
-         {
-            try
-            {
-               removeItemsStatement.close();
-            }
-            catch (SQLException e)
-            {
-               LOG.error("Can't close statement", e);
-            }
-         }
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
    protected ResultSet findMaxPropertyVersion(String parentId, String name, int index) throws SQLException
    {
       if (findMaxPropertyVersions == null)

Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java	2012-03-12 12:45:05 UTC (rev 5840)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java	2012-03-12 12:49:32 UTC (rev 5841)
@@ -635,61 +635,6 @@
    /**
     * {@inheritDoc}
     */
-   protected void deleteLockProperties(String nodeIdentifier) throws SQLException
-   {
-      PreparedStatement removeValuesStatement = null;
-      PreparedStatement removeItemsStatement = null;
-
-      try
-      {
-         removeValuesStatement =
-            dbConnection.prepareStatement("DELETE FROM JCR_SVALUE WHERE PROPERTY_ID IN (SELECT ID FROM JCR_SITEM"
-               + " WHERE CONTAINER_NAME = ? AND PARENT_ID=? AND (NAME = '[http://www.jcp.org/jcr/1.0]lockIsDeep' OR"
-               + " NAME = '[http://www.jcp.org/jcr/1.0]lockOwner'))");
-         removeValuesStatement.setString(1, containerName);
-         removeValuesStatement.setString(2, getInternalId(nodeIdentifier));
-
-         removeItemsStatement =
-            dbConnection.prepareStatement("DELETE FROM JCR_SITEM WHERE CONTAINER_NAME = ? AND PARENT_ID=? AND"
-               + " (NAME = '[http://www.jcp.org/jcr/1.0]lockIsDeep' OR"
-               + " NAME = '[http://www.jcp.org/jcr/1.0]lockOwner')");
-         removeItemsStatement.setString(1, containerName);
-         removeItemsStatement.setString(2, getInternalId(nodeIdentifier));
-
-         removeValuesStatement.executeUpdate();
-         removeItemsStatement.executeUpdate();
-      }
-      finally
-      {
-         if (removeValuesStatement != null)
-         {
-            try
-            {
-               removeValuesStatement.close();
-            }
-            catch (SQLException e)
-            {
-               LOG.error("Can't close statement", e);
-            }
-         }
-
-         if (removeItemsStatement != null)
-         {
-            try
-            {
-               removeItemsStatement.close();
-            }
-            catch (SQLException e)
-            {
-               LOG.error("Can't close statement", e);
-            }
-         }
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
    protected ResultSet findMaxPropertyVersion(String parentId, String name, int index) throws SQLException
    {
       if (findMaxPropertyVersions == null)

Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java	2012-03-12 12:45:05 UTC (rev 5840)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java	2012-03-12 12:49:32 UTC (rev 5841)
@@ -1090,61 +1090,6 @@
    /**
     * {@inheritDoc}
     */
-   protected void deleteLockProperties(String nodeIdentifier) throws SQLException
-   {
-      PreparedStatement removeValuesStatement = null;
-      PreparedStatement removeItemsStatement = null;
-
-      try
-      {
-         removeValuesStatement =
-            dbConnection.prepareStatement("DELETE FROM JCR_MVALUE WHERE PROPERTY_ID IN"
-               + " (SELECT ID FROM JCR_MITEM WHERE PARENT_ID=? AND"
-               + " (NAME = '[http://www.jcp.org/jcr/1.0]lockIsDeep' OR"
-               + " NAME = '[http://www.jcp.org/jcr/1.0]lockOwner'))");
-
-         removeItemsStatement =
-            dbConnection.prepareStatement("DELETE FROM JCR_MITEM WHERE PARENT_ID=? AND"
-               + " (NAME = '[http://www.jcp.org/jcr/1.0]lockIsDeep' OR"
-               + " NAME = '[http://www.jcp.org/jcr/1.0]lockOwner')");
-
-         removeValuesStatement.setString(1, getInternalId(nodeIdentifier));
-         removeItemsStatement.setString(1, getInternalId(nodeIdentifier));
-
-         removeValuesStatement.executeUpdate();
-         removeItemsStatement.executeUpdate();
-      }
-      finally
-      {
-         if (removeValuesStatement != null)
-         {
-            try
-            {
-               removeValuesStatement.close();
-            }
-            catch (SQLException e)
-            {
-               LOG.error("Can't close statement", e);
-            }
-         }
-
-         if (removeItemsStatement != null)
-         {
-            try
-            {
-               removeItemsStatement.close();
-            }
-            catch (SQLException e)
-            {
-               LOG.error("Can't close statement", e);
-            }
-         }
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
    protected ResultSet findMaxPropertyVersion(String parentId, String name, int index) throws SQLException
    {
       if (findMaxPropertyVersions == null)

Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java	2012-03-12 12:45:05 UTC (rev 5840)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java	2012-03-12 12:49:32 UTC (rev 5841)
@@ -1014,61 +1014,6 @@
    /**
     * {@inheritDoc}
     */
-   protected void deleteLockProperties(String nodeIdentifier) throws SQLException
-   {
-      PreparedStatement removeValuesStatement = null;
-      PreparedStatement removeItemsStatement = null;
-
-      try
-      {
-         removeValuesStatement =
-            dbConnection.prepareStatement("DELETE FROM JCR_SVALUE WHERE PROPERTY_ID IN (SELECT ID FROM JCR_SITEM"
-               + " WHERE CONTAINER_NAME = ? AND PARENT_ID=? AND (NAME = '[http://www.jcp.org/jcr/1.0]lockIsDeep' OR"
-               + " NAME = '[http://www.jcp.org/jcr/1.0]lockOwner'))");
-         removeValuesStatement.setString(1, containerName);
-         removeValuesStatement.setString(2, getInternalId(nodeIdentifier));
-
-         removeItemsStatement =
-            dbConnection.prepareStatement("DELETE FROM JCR_SITEM WHERE CONTAINER_NAME = ? AND PARENT_ID=? AND"
-               + " (NAME = '[http://www.jcp.org/jcr/1.0]lockIsDeep' OR"
-               + " NAME = '[http://www.jcp.org/jcr/1.0]lockOwner')");
-         removeItemsStatement.setString(1, containerName);
-         removeItemsStatement.setString(2, getInternalId(nodeIdentifier));
-
-         removeValuesStatement.executeUpdate();
-         removeItemsStatement.executeUpdate();
-      }
-      finally
-      {
-         if (removeValuesStatement != null)
-         {
-            try
-            {
-               removeValuesStatement.close();
-            }
-            catch (SQLException e)
-            {
-               LOG.error("Can't close statement", e);
-            }
-         }
-
-         if (removeItemsStatement != null)
-         {
-            try
-            {
-               removeItemsStatement.close();
-            }
-            catch (SQLException e)
-            {
-               LOG.error("Can't close statement", e);
-            }
-         }
-      }
-   }
-
-   /**
-    * {@inheritDoc}
-    */
    protected ResultSet findMaxPropertyVersion(String parentId, String name, int index) throws SQLException
    {
       if (findMaxPropertyVersions == null)



More information about the exo-jcr-commits mailing list