Author: tolusha
Date: 2012-03-12 08:51:13 -0400 (Mon, 12 Mar 2012)
New Revision: 5842
Modified:
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java
jcr/branches/1.15.x/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/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java
===================================================================
---
jcr/branches/1.15.x/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)
+++
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2012-03-12
12:51:13 UTC (rev 5842)
@@ -24,7 +24,17 @@
import org.exoplatform.services.jcr.dataflow.ItemState;
import org.exoplatform.services.jcr.dataflow.persistent.PersistedNodeData;
import org.exoplatform.services.jcr.dataflow.persistent.PersistedPropertyData;
-import org.exoplatform.services.jcr.datamodel.*;
+import org.exoplatform.services.jcr.datamodel.IllegalACLException;
+import org.exoplatform.services.jcr.datamodel.IllegalNameException;
+import org.exoplatform.services.jcr.datamodel.InternalQName;
+import org.exoplatform.services.jcr.datamodel.ItemData;
+import org.exoplatform.services.jcr.datamodel.ItemType;
+import org.exoplatform.services.jcr.datamodel.NodeData;
+import org.exoplatform.services.jcr.datamodel.NodeDataIndexing;
+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.itemfilters.QPathEntryFilter;
import org.exoplatform.services.jcr.impl.dataflow.persistent.ACLHolder;
@@ -2865,12 +2875,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/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java
===================================================================
---
jcr/branches/1.15.x/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)
+++
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java 2012-03-12
12:51:13 UTC (rev 5842)
@@ -700,60 +700,6 @@
/**
* {@inheritDoc}
*/
- protected void deleteLockProperties(String nodeIdentifier) throws SQLException
- {
- PreparedStatement removeValuesStatement = null;
- PreparedStatement removeItemsStatement = null;
-
- try
- {
- removeValuesStatement =
- dbConnection.prepareStatement("DELETE FROM " + JCR_VALUE + "
WHERE PROPERTY_ID IN" + " (SELECT ID FROM "
- + JCR_ITEM + " 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_ITEM + "
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/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java
===================================================================
---
jcr/branches/1.15.x/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)
+++
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java 2012-03-12
12:51:13 UTC (rev 5842)
@@ -716,63 +716,8 @@
}
/**
- * {@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, containerConfig.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, containerConfig.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}
- */
+ * {@inheritDoc}
+ */
protected ResultSet findMaxPropertyVersion(String parentId, String name, int index)
throws SQLException
{
if (findMaxPropertyVersions == null)
Modified:
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java
===================================================================
---
jcr/branches/1.15.x/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)
+++
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java 2012-03-12
12:51:13 UTC (rev 5842)
@@ -1088,60 +1088,6 @@
/**
* {@inheritDoc}
*/
- protected void deleteLockProperties(String nodeIdentifier) throws SQLException
- {
- PreparedStatement removeValuesStatement = null;
- PreparedStatement removeItemsStatement = null;
-
- try
- {
- removeValuesStatement =
- dbConnection.prepareStatement("DELETE FROM " + JCR_VALUE + "
WHERE PROPERTY_ID IN" + " (SELECT ID FROM "
- + JCR_ITEM + " 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_ITEM + "
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}
- */
@Override
protected ResultSet findNodesCount() throws SQLException
{
Modified:
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java
===================================================================
---
jcr/branches/1.15.x/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)
+++
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java 2012-03-12
12:51:13 UTC (rev 5842)
@@ -1132,61 +1132,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, containerConfig.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, containerConfig.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)