Author: nfilotto
Date: 2011-02-11 14:44:55 -0500 (Fri, 11 Feb 2011)
New Revision: 3970
Removed:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SybaseMultiDbJDBCConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SybaseSingleDbJDBCConnection.java
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/JDBCWorkspaceDataContainer.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/GenericConnectionFactory.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/HSQLDBMultiDbJDBCConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/HSQLDBSingleDbJDBCConnection.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/MySQLMultiDbJDBCConnection.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/indexing/JdbcNodeDataIndexingIterator.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCWorkspaceDataContainer.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/DB2MultiDbJDBCConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/DB2SingleDbJDBCConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/GenericCQConnectionFactory.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/HSQLDBConnectionFactory.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/HSQLDBMultiDbJDBCConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/HSQLDBSingleDbJDBCConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MSSQLMultiDbJDBCConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MSSQLSingleDbJDBCConnection.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/MySQLMultiDbJDBCConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MySQLSingleDbJDBCConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/OracleMultiDbJDBCConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/OracleSingleDbJDBCConnection.java
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/SybaseConnectionFactory.java
Log:
EXOJCR-1104: The changes applied are the following:
1. Now, we know if indexing is supported thanks to the connection factory.
2. The hard coded test on the ds type has been removed
3. The Sybase connection classes have been removed since the rdbms indexing mechanism is
not supported on sybase
4. The new method has been removed from HSLQDB since the rdbms indexing mechanism is not
supported on HSLQDB
5. The last node id has been added to the new method in order to know from which to start
for the next page, this allows to limit the offset which affects the performances of the
query when the value is high.
6. Since we have no clue that this new approach based on the last node id will help on
DB2, Oracle and MSSQL, the node id is ignored with those db
7. To enable the log in order to see more info while indexing add the JVM system parameter
"-Dexo.product.developing=true"
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 2011-02-11
15:41:56 UTC (rev 3969)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2011-02-11
19:44:55 UTC (rev 3970)
@@ -1013,6 +1013,7 @@
/**
* GetNodesAndProperties.
*
+ * @param lastNodeId the id if the last doc get from the db
* @param offset
* @param limit
* @param result
@@ -1020,7 +1021,7 @@
* @throws RepositoryException
* @throws IllegalStateException
*/
- public List<NodeDataIndexing> getNodesAndProperties(int offset, int limit)
throws RepositoryException,
+ public List<NodeDataIndexing> getNodesAndProperties(String lastNodeId, int
offset, int limit) throws RepositoryException,
IllegalStateException
{
List<NodeDataIndexing> result = new ArrayList<NodeDataIndexing>();
@@ -1028,9 +1029,7 @@
checkIfOpened();
try
{
- long start = System.currentTimeMillis();
- ResultSet resultSet = findNodesAndProperties(offset, limit);
- LOG.debug("offset=" + offset + " limit=" + limit + "
time=" + (System.currentTimeMillis() - start));
+ ResultSet resultSet = findNodesAndProperties(lastNodeId, offset, limit);
try
{
@@ -2777,7 +2776,7 @@
protected abstract ResultSet findChildPropertiesByParentIdentifier(String
parentIdentifier) throws SQLException;
- protected abstract ResultSet findNodesAndProperties(int offset, int limit) throws
SQLException;
+ protected abstract ResultSet findNodesAndProperties(String lastNodeId, int offset, int
limit) throws SQLException;
protected abstract int addReference(PropertyData data) throws SQLException,
IOException;
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java 2011-02-11
15:41:56 UTC (rev 3969)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java 2011-02-11
19:44:55 UTC (rev 3970)
@@ -1423,7 +1423,11 @@
*/
public NodeDataIndexingIterator getNodeDataIndexingIterator(int pageSize) throws
RepositoryException
{
- return new JdbcNodeDataIndexingIterator(connFactory, pageSize);
+ if (isReindexingSupport())
+ {
+ return new JdbcNodeDataIndexingIterator(connFactory, pageSize);
+ }
+ throw new UnsupportedOperationException("The method
getNodeDataIndexingIterator is not supported for this type of connection use the complex
queries instead");
}
/**
@@ -1431,6 +1435,6 @@
*/
public boolean isReindexingSupport()
{
- return false;
+ return connFactory.isReindexingSupport();
}
}
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/GenericConnectionFactory.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/GenericConnectionFactory.java 2011-02-11
15:41:56 UTC (rev 3969)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/GenericConnectionFactory.java 2011-02-11
19:44:55 UTC (rev 3970)
@@ -261,4 +261,14 @@
{
return getJdbcConnection(false);
}
+
+ /**
+ * Indicates if component support extracting data from storage using paging.
+ *
+ * @return boolean
+ */
+ public boolean isReindexingSupport()
+ {
+ return false;
+ }
}
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/HSQLDBMultiDbJDBCConnection.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/HSQLDBMultiDbJDBCConnection.java 2011-02-11
15:41:56 UTC (rev 3969)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/HSQLDBMultiDbJDBCConnection.java 2011-02-11
19:44:55 UTC (rev 3970)
@@ -331,20 +331,4 @@
}
});
}
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected ResultSet findNodesAndProperties(final int offset, final int limit) throws
SQLException
- {
- PrivilegedExceptionAction<ResultSet> action = new
PrivilegedExceptionAction<ResultSet>()
- {
- public ResultSet run() throws Exception
- {
- return HSQLDBMultiDbJDBCConnection.super.findNodesAndProperties(offset,
limit);
- }
- };
- return SecurityHelper.doPrivilegedSQLExceptionAction(action);
- }
}
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/HSQLDBSingleDbJDBCConnection.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/HSQLDBSingleDbJDBCConnection.java 2011-02-11
15:41:56 UTC (rev 3969)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/HSQLDBSingleDbJDBCConnection.java 2011-02-11
19:44:55 UTC (rev 3970)
@@ -459,20 +459,4 @@
};
return SecurityHelper.doPrivilegedSQLExceptionAction(action);
}
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected ResultSet findNodesAndProperties(final int offset, final int limit) throws
SQLException
- {
- PrivilegedExceptionAction<ResultSet> action = new
PrivilegedExceptionAction<ResultSet>()
- {
- public ResultSet run() throws Exception
- {
- return HSQLDBSingleDbJDBCConnection.super.findNodesAndProperties(offset,
limit);
- }
- };
- return SecurityHelper.doPrivilegedSQLExceptionAction(action);
- }
}
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 2011-02-11
15:41:56 UTC (rev 3969)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java 2011-02-11
19:44:55 UTC (rev 3970)
@@ -519,20 +519,8 @@
* {@inheritDoc}
*/
@Override
- protected ResultSet findNodesAndProperties(int offset, int limit) throws SQLException
+ protected ResultSet findNodesAndProperties(String lastNodeId, int offset, int limit)
throws SQLException
{
- if (findNodesAndProperties == null)
- {
- findNodesAndProperties =
dbConnection.prepareStatement(FIND_NODES_AND_PROPERTIES);
- }
- else
- {
- findNodesAndProperties.clearParameters();
- }
-
- findNodesAndProperties.setInt(1, limit);
- findNodesAndProperties.setInt(2, offset);
-
- return findNodesAndProperties.executeQuery();
+ throw new UnsupportedOperationException("The method findNodesAndProperties is
not supported for this type of connection use the complex queries instead");
}
}
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/MySQLMultiDbJDBCConnection.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/MySQLMultiDbJDBCConnection.java 2011-02-11
15:41:56 UTC (rev 3969)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/MySQLMultiDbJDBCConnection.java 2011-02-11
19:44:55 UTC (rev 3970)
@@ -72,15 +72,6 @@
* {@inheritDoc}
*/
@Override
- protected void prepareQueries() throws SQLException
- {
- super.prepareQueries();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
protected int addNodeRecord(NodeData data) throws SQLException
{
// check if parent exists
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 2011-02-11
15:41:56 UTC (rev 3969)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java 2011-02-11
19:44:55 UTC (rev 3970)
@@ -540,22 +540,8 @@
* {@inheritDoc}
*/
@Override
- protected ResultSet findNodesAndProperties(int offset, int limit) throws SQLException
+ protected ResultSet findNodesAndProperties(String lastNodeId, int offset, int limit)
throws SQLException
{
- if (findNodesAndProperties == null)
- {
- findNodesAndProperties =
dbConnection.prepareStatement(FIND_NODES_AND_PROPERTIES);
- }
- else
- {
- findNodesAndProperties.clearParameters();
- }
-
- findNodesAndProperties.setString(1, containerName);
- findNodesAndProperties.setInt(2, limit);
- findNodesAndProperties.setInt(3, offset);
- findNodesAndProperties.setString(4, containerName);
-
- return findNodesAndProperties.executeQuery();
+ throw new UnsupportedOperationException("The method findNodesAndProperties is
not supported for this type of connection use the complex queries instead");
}
}
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/indexing/JdbcNodeDataIndexingIterator.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/indexing/JdbcNodeDataIndexingIterator.java 2011-02-11
15:41:56 UTC (rev 3969)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/indexing/JdbcNodeDataIndexingIterator.java 2011-02-11
19:44:55 UTC (rev 3970)
@@ -18,6 +18,7 @@
*/
package org.exoplatform.services.jcr.impl.storage.jdbc.indexing;
+import org.exoplatform.commons.utils.PropertyManager;
import org.exoplatform.services.jcr.datamodel.NodeDataIndexing;
import org.exoplatform.services.jcr.impl.core.query.NodeDataIndexingIterator;
import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCStorageConnection;
@@ -29,6 +30,7 @@
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicReference;
import javax.jcr.RepositoryException;
@@ -58,12 +60,22 @@
/**
* The current offset in database.
*/
- private AtomicInteger offset = new AtomicInteger(0);
+ private final AtomicInteger offset = new AtomicInteger(0);
/**
* Indicates if not all records have been read from database.
*/
- private AtomicBoolean hasNext = new AtomicBoolean(true);
+ private final AtomicBoolean hasNext = new AtomicBoolean(true);
+
+ /**
+ * The last node Id retrieved from the DB
+ */
+ private final AtomicReference<String> lastNodeId = new
AtomicReference<String>("");
+
+ /**
+ * The current page index
+ */
+ private static final AtomicInteger page = new AtomicInteger();
/**
* Logger.
@@ -94,8 +106,28 @@
JDBCStorageConnection conn = (JDBCStorageConnection)connFactory.openConnection();
try
{
- List<NodeDataIndexing> result =
conn.getNodesAndProperties(offset.getAndAdd(pageSize), pageSize);
+ int currentOffset;
+ String currentLastNodeId;
+ int currentPage;
+ synchronized (this)
+ {
+ currentOffset = offset.getAndAdd(pageSize);
+ currentLastNodeId = lastNodeId.get();
+ currentPage = page.incrementAndGet();
+ }
+ long time = System.currentTimeMillis();
+ List<NodeDataIndexing> result =
conn.getNodesAndProperties(currentLastNodeId, currentOffset, pageSize);
+ if (PropertyManager.isDevelopping())
+ LOG.info("Page = " + currentPage + " Offset = " +
currentOffset + " LastNodeId = '" + currentLastNodeId + "', query
time = " + (System.currentTimeMillis() - time) + " ms, from '" +
result.get(0).getIdentifier() + "' to '" + result.get(result.size() -
1).getIdentifier() + "'");
hasNext.compareAndSet(true, result.size() == pageSize);
+ if (hasNext())
+ {
+ synchronized (this)
+ {
+ lastNodeId.set(result.get(result.size() - 1).getIdentifier());
+ offset.set((page.get() - currentPage) * pageSize);
+ }
+ }
return result;
}
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCWorkspaceDataContainer.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCWorkspaceDataContainer.java 2011-02-11
15:41:56 UTC (rev 3969)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCWorkspaceDataContainer.java 2011-02-11
19:44:55 UTC (rev 3970)
@@ -368,14 +368,5 @@
return new GenericCQConnectionFactory(dbDriver, dbUrl, dbUserName, dbPassword,
containerName, multiDb,
valueStorageProvider, maxBufferSize, swapDirectory, swapCleaner);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean isReindexingSupport()
- {
- return !dbDialect.equals(DBConstants.DB_DIALECT_SYBASE) &&
!dbDialect.equals(DBConstants.DB_DIALECT_HSQLDB);
- }
+ }
}
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/DB2MultiDbJDBCConnection.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/DB2MultiDbJDBCConnection.java 2011-02-11
15:41:56 UTC (rev 3969)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/DB2MultiDbJDBCConnection.java 2011-02-11
19:44:55 UTC (rev 3970)
@@ -21,6 +21,7 @@
import java.io.File;
import java.sql.Connection;
+import java.sql.ResultSet;
import java.sql.SQLException;
/**
@@ -76,4 +77,25 @@
+ " from JCR_SITEM I where I.I_CLASS=1) as A where A.r__ <= ? and
A.r__ > ?) J on P.PARENT_ID = J.ID"
+ " where P.I_CLASS=2 and V.PROPERTY_ID=P.ID order by J.ID";
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected ResultSet findNodesAndProperties(String lastNodeId, int offset, int limit)
throws SQLException
+ {
+ if (findNodesAndProperties == null)
+ {
+ findNodesAndProperties =
dbConnection.prepareStatement(FIND_NODES_AND_PROPERTIES);
+ }
+ else
+ {
+ findNodesAndProperties.clearParameters();
+ }
+
+ findNodesAndProperties.setInt(1, limit);
+ findNodesAndProperties.setInt(2, offset);
+
+ return findNodesAndProperties.executeQuery();
+ }
}
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/DB2SingleDbJDBCConnection.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/DB2SingleDbJDBCConnection.java 2011-02-11
15:41:56 UTC (rev 3969)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/DB2SingleDbJDBCConnection.java 2011-02-11
19:44:55 UTC (rev 3970)
@@ -21,6 +21,7 @@
import java.io.File;
import java.sql.Connection;
+import java.sql.ResultSet;
import java.sql.SQLException;
/**
@@ -77,4 +78,27 @@
+ ") J on P.PARENT_ID = J.ID"
+ " where P.I_CLASS=2 and P.CONTAINER_NAME=? and V.PROPERTY_ID=P.ID
order by J.ID";
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected ResultSet findNodesAndProperties(String lastNodeId, int offset, int limit)
throws SQLException
+ {
+ if (findNodesAndProperties == null)
+ {
+ findNodesAndProperties =
dbConnection.prepareStatement(FIND_NODES_AND_PROPERTIES);
+ }
+ else
+ {
+ findNodesAndProperties.clearParameters();
+ }
+
+ findNodesAndProperties.setString(1, containerName);
+ findNodesAndProperties.setInt(2, limit);
+ findNodesAndProperties.setInt(3, offset);
+ findNodesAndProperties.setString(4, containerName);
+
+ return findNodesAndProperties.executeQuery();
+ }
}
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/GenericCQConnectionFactory.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/GenericCQConnectionFactory.java 2011-02-11
15:41:56 UTC (rev 3969)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/GenericCQConnectionFactory.java 2011-02-11
19:44:55 UTC (rev 3970)
@@ -253,5 +253,13 @@
{
return getJdbcConnection(false);
}
-
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean isReindexingSupport()
+ {
+ return true;
+ }
}
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/HSQLDBConnectionFactory.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/HSQLDBConnectionFactory.java 2011-02-11
15:41:56 UTC (rev 3969)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/HSQLDBConnectionFactory.java 2011-02-11
19:44:55 UTC (rev 3970)
@@ -122,4 +122,13 @@
throw new RepositoryException(e);
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean isReindexingSupport()
+ {
+ return false;
+ }
}
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/HSQLDBMultiDbJDBCConnection.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/HSQLDBMultiDbJDBCConnection.java 2011-02-11
15:41:56 UTC (rev 3969)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/HSQLDBMultiDbJDBCConnection.java 2011-02-11
19:44:55 UTC (rev 3970)
@@ -395,20 +395,4 @@
}
});
}
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected ResultSet findNodesAndProperties(final int offset, final int limit) throws
SQLException
- {
- PrivilegedExceptionAction<ResultSet> action = new
PrivilegedExceptionAction<ResultSet>()
- {
- public ResultSet run() throws Exception
- {
- return HSQLDBMultiDbJDBCConnection.super.findNodesAndProperties(offset,
limit);
- }
- };
- return SecurityHelper.doPrivilegedSQLExceptionAction(action);
- }
}
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/HSQLDBSingleDbJDBCConnection.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/HSQLDBSingleDbJDBCConnection.java 2011-02-11
15:41:56 UTC (rev 3969)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/HSQLDBSingleDbJDBCConnection.java 2011-02-11
19:44:55 UTC (rev 3970)
@@ -563,20 +563,4 @@
};
return SecurityHelper.doPrivilegedSQLExceptionAction(action);
}
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected ResultSet findNodesAndProperties(final int offset, final int limit) throws
SQLException
- {
- PrivilegedExceptionAction<ResultSet> action = new
PrivilegedExceptionAction<ResultSet>()
- {
- public ResultSet run() throws Exception
- {
- return HSQLDBSingleDbJDBCConnection.super.findNodesAndProperties(offset,
limit);
- }
- };
- return SecurityHelper.doPrivilegedSQLExceptionAction(action);
- }
}
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MSSQLMultiDbJDBCConnection.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MSSQLMultiDbJDBCConnection.java 2011-02-11
15:41:56 UTC (rev 3969)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MSSQLMultiDbJDBCConnection.java 2011-02-11
19:44:55 UTC (rev 3970)
@@ -21,6 +21,7 @@
import java.io.File;
import java.sql.Connection;
+import java.sql.ResultSet;
import java.sql.SQLException;
/**
@@ -74,4 +75,25 @@
+ " from JCR_SITEM I where I.I_CLASS=1) as A where A.r__ <= ? and
A.r__ > ?) J on P.PARENT_ID = J.ID"
+ " where P.I_CLASS=2 and V.PROPERTY_ID=P.ID order by J.ID";
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected ResultSet findNodesAndProperties(String lastNodeId, int offset, int limit)
throws SQLException
+ {
+ if (findNodesAndProperties == null)
+ {
+ findNodesAndProperties =
dbConnection.prepareStatement(FIND_NODES_AND_PROPERTIES);
+ }
+ else
+ {
+ findNodesAndProperties.clearParameters();
+ }
+
+ findNodesAndProperties.setInt(1, limit);
+ findNodesAndProperties.setInt(2, offset);
+
+ return findNodesAndProperties.executeQuery();
+ }
}
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MSSQLSingleDbJDBCConnection.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MSSQLSingleDbJDBCConnection.java 2011-02-11
15:41:56 UTC (rev 3969)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MSSQLSingleDbJDBCConnection.java 2011-02-11
19:44:55 UTC (rev 3970)
@@ -21,6 +21,7 @@
import java.io.File;
import java.sql.Connection;
+import java.sql.ResultSet;
import java.sql.SQLException;
/**
@@ -77,4 +78,27 @@
+ " ) J on P.PARENT_ID = J.ID"
+ " where P.I_CLASS=2 and P.CONTAINER_NAME=? and V.PROPERTY_ID=P.ID
order by J.ID";
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected ResultSet findNodesAndProperties(String lastNodeId, int offset, int limit)
throws SQLException
+ {
+ if (findNodesAndProperties == null)
+ {
+ findNodesAndProperties =
dbConnection.prepareStatement(FIND_NODES_AND_PROPERTIES);
+ }
+ else
+ {
+ findNodesAndProperties.clearParameters();
+ }
+
+ findNodesAndProperties.setString(1, containerName);
+ findNodesAndProperties.setInt(2, limit);
+ findNodesAndProperties.setInt(3, offset);
+ findNodesAndProperties.setString(4, containerName);
+
+ return findNodesAndProperties.executeQuery();
+ }
}
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 2011-02-11
15:41:56 UTC (rev 3969)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java 2011-02-11
19:44:55 UTC (rev 3970)
@@ -184,7 +184,7 @@
"select J.*, P.ID AS P_ID, P.NAME AS P_NAME, P.VERSION AS P_VERSION,
P.P_TYPE, P.P_MULTIVALUED,"
+ " V.DATA, V.ORDER_NUM, V.STORAGE_DESC from JCR_MVALUE V, JCR_MITEM
P"
+ " join (select I.ID, I.PARENT_ID, I.NAME, I.VERSION, I.I_INDEX,
I.N_ORDER_NUM from JCR_MITEM I"
- + " where I.I_CLASS=1 order by I.ID LIMIT ? OFFSET ?) J on P.PARENT_ID =
J.ID"
+ + " where I.I_CLASS=1 AND I.ID > ? order by I.ID LIMIT ? OFFSET ?) J
on P.PARENT_ID = J.ID"
+ " where P.I_CLASS=2 and V.PROPERTY_ID=P.ID order by J.ID";
}
@@ -614,7 +614,7 @@
* {@inheritDoc}
*/
@Override
- protected ResultSet findNodesAndProperties(int offset, int limit) throws SQLException
+ protected ResultSet findNodesAndProperties(String lastNodeId, int offset, int limit)
throws SQLException
{
if (findNodesAndProperties == null)
{
@@ -625,8 +625,9 @@
findNodesAndProperties.clearParameters();
}
- findNodesAndProperties.setInt(1, limit);
- findNodesAndProperties.setInt(2, offset);
+ findNodesAndProperties.setString(1, lastNodeId);
+ findNodesAndProperties.setInt(2, limit);
+ findNodesAndProperties.setInt(3, offset);
return findNodesAndProperties.executeQuery();
}
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MySQLMultiDbJDBCConnection.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MySQLMultiDbJDBCConnection.java 2011-02-11
15:41:56 UTC (rev 3969)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MySQLMultiDbJDBCConnection.java 2011-02-11
19:44:55 UTC (rev 3970)
@@ -72,21 +72,6 @@
* {@inheritDoc}
*/
@Override
- protected void prepareQueries() throws SQLException
- {
- super.prepareQueries();
- FIND_NODES_AND_PROPERTIES =
- "select J.*, P.ID AS P_ID, P.NAME AS P_NAME, P.VERSION AS P_VERSION,
P.P_TYPE, P.P_MULTIVALUED,"
- + " V.DATA, V.ORDER_NUM, V.STORAGE_DESC from JCR_MVALUE V, JCR_MITEM P
use index(JCR_IDX_MITEM_PARENT_ID)"
- + " join (select I.ID, I.PARENT_ID, I.NAME, I.VERSION, I.I_INDEX,
I.N_ORDER_NUM from JCR_MITEM I"
- + " where I.I_CLASS=1 order by I.ID LIMIT ? OFFSET ?) J on P.PARENT_ID =
J.ID"
- + " where P.I_CLASS=2 and V.PROPERTY_ID=P.ID order by J.ID";
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
protected int addNodeRecord(NodeData data) throws SQLException
{
// check if parent exists
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MySQLSingleDbJDBCConnection.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MySQLSingleDbJDBCConnection.java 2011-02-11
15:41:56 UTC (rev 3969)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MySQLSingleDbJDBCConnection.java 2011-02-11
19:44:55 UTC (rev 3970)
@@ -72,21 +72,6 @@
* {@inheritDoc}
*/
@Override
- protected void prepareQueries() throws SQLException
- {
- super.prepareQueries();
- FIND_NODES_AND_PROPERTIES =
- "select J.*, P.ID AS P_ID, P.NAME AS P_NAME, P.VERSION AS P_VERSION,
P.P_TYPE, P.P_MULTIVALUED,"
- + " V.DATA, V.ORDER_NUM, V.STORAGE_DESC from JCR_SVALUE V, JCR_SITEM P
use index(JCR_IDX_SITEM_PARENT_ID)"
- + " join (select I.ID, I.PARENT_ID, I.NAME, I.VERSION, I.I_INDEX,
I.N_ORDER_NUM from JCR_SITEM I"
- + " where I.CONTAINER_NAME=? AND I.I_CLASS=1 order by I.ID LIMIT ?
OFFSET ?) J on P.PARENT_ID = J.ID"
- + " where P.I_CLASS=2 and P.CONTAINER_NAME=? and V.PROPERTY_ID=P.ID
order by J.ID";
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
protected int addNodeRecord(NodeData data) throws SQLException
{
// check if parent exists
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/OracleMultiDbJDBCConnection.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/OracleMultiDbJDBCConnection.java 2011-02-11
15:41:56 UTC (rev 3969)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/OracleMultiDbJDBCConnection.java 2011-02-11
19:44:55 UTC (rev 3970)
@@ -21,6 +21,7 @@
import java.io.File;
import java.sql.Connection;
+import java.sql.ResultSet;
import java.sql.SQLException;
/**
@@ -87,4 +88,25 @@
+ " where I.I_CLASS=1 order by I.ID) A where ROWNUM <= ?) where r__
> ?) J on P.PARENT_ID = J.ID"
+ " where P.I_CLASS=2 and V.PROPERTY_ID=P.ID order by J.ID";
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected ResultSet findNodesAndProperties(String lastNodeId, int offset, int limit)
throws SQLException
+ {
+ if (findNodesAndProperties == null)
+ {
+ findNodesAndProperties =
dbConnection.prepareStatement(FIND_NODES_AND_PROPERTIES);
+ }
+ else
+ {
+ findNodesAndProperties.clearParameters();
+ }
+
+ findNodesAndProperties.setInt(1, limit);
+ findNodesAndProperties.setInt(2, offset);
+
+ return findNodesAndProperties.executeQuery();
+ }
}
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/OracleSingleDbJDBCConnection.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/OracleSingleDbJDBCConnection.java 2011-02-11
15:41:56 UTC (rev 3969)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/OracleSingleDbJDBCConnection.java 2011-02-11
19:44:55 UTC (rev 3970)
@@ -21,6 +21,7 @@
import java.io.File;
import java.sql.Connection;
+import java.sql.ResultSet;
import java.sql.SQLException;
/**
@@ -89,4 +90,27 @@
+ " ) A where ROWNUM <= ?) where r__ > ?) J on P.PARENT_ID =
J.ID"
+ " where P.I_CLASS=2 and P.CONTAINER_NAME=? and V.PROPERTY_ID=P.ID
order by J.ID";
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected ResultSet findNodesAndProperties(String lastNodeId, int offset, int limit)
throws SQLException
+ {
+ if (findNodesAndProperties == null)
+ {
+ findNodesAndProperties =
dbConnection.prepareStatement(FIND_NODES_AND_PROPERTIES);
+ }
+ else
+ {
+ findNodesAndProperties.clearParameters();
+ }
+
+ findNodesAndProperties.setString(1, containerName);
+ findNodesAndProperties.setInt(2, limit);
+ findNodesAndProperties.setInt(3, offset);
+ findNodesAndProperties.setString(4, containerName);
+
+ return findNodesAndProperties.executeQuery();
+ }
}
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 2011-02-11
15:41:56 UTC (rev 3969)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java 2011-02-11
19:44:55 UTC (rev 3970)
@@ -191,7 +191,7 @@
"select J.*, P.ID AS P_ID, P.NAME AS P_NAME, P.VERSION AS P_VERSION,
P.P_TYPE, P.P_MULTIVALUED,"
+ " V.DATA, V.ORDER_NUM, V.STORAGE_DESC from JCR_SVALUE V, JCR_SITEM
P"
+ " join (select I.ID, I.PARENT_ID, I.NAME, I.VERSION, I.I_INDEX,
I.N_ORDER_NUM from JCR_SITEM I"
- + " where I.CONTAINER_NAME=? AND I.I_CLASS=1 order by I.ID LIMIT ?
OFFSET ?) J on P.PARENT_ID = J.ID"
+ + " where I.CONTAINER_NAME=? AND I.I_CLASS=1 AND I.ID > ? order by
I.ID LIMIT ? OFFSET ?) J on P.PARENT_ID = J.ID"
+ " where P.I_CLASS=2 and P.CONTAINER_NAME=? and V.PROPERTY_ID=P.ID
order by J.ID";
}
@@ -635,7 +635,7 @@
* {@inheritDoc}
*/
@Override
- protected ResultSet findNodesAndProperties(int offset, int limit) throws SQLException
+ protected ResultSet findNodesAndProperties(String lastNodeId, int offset, int limit)
throws SQLException
{
if (findNodesAndProperties == null)
{
@@ -647,9 +647,10 @@
}
findNodesAndProperties.setString(1, containerName);
- findNodesAndProperties.setInt(2, limit);
- findNodesAndProperties.setInt(3, offset);
- findNodesAndProperties.setString(4, containerName);
+ findNodesAndProperties.setString(2, getInternalId(lastNodeId));
+ findNodesAndProperties.setInt(3, limit);
+ findNodesAndProperties.setInt(4, offset);
+ findNodesAndProperties.setString(5, containerName);
return findNodesAndProperties.executeQuery();
}
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SybaseConnectionFactory.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SybaseConnectionFactory.java 2011-02-11
15:41:56 UTC (rev 3969)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SybaseConnectionFactory.java 2011-02-11
19:44:55 UTC (rev 3970)
@@ -19,11 +19,9 @@
package org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.db;
import org.exoplatform.services.jcr.impl.util.io.FileCleaner;
-import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection;
import org.exoplatform.services.jcr.storage.value.ValueStoragePluginProvider;
import java.io.File;
-import java.sql.SQLException;
import javax.jcr.RepositoryException;
import javax.sql.DataSource;
@@ -98,28 +96,13 @@
{
super(dbDataSource, containerName, multiDb, valueStorageProvider, maxBufferSize,
swapDirectory, swapCleaner);
}
-
+
/**
* {@inheritDoc}
*/
@Override
- public WorkspaceStorageConnection openConnection(boolean readOnly) throws
RepositoryException
+ public boolean isReindexingSupport()
{
- try
- {
- if (multiDb)
- {
- return new SybaseMultiDbJDBCConnection(getJdbcConnection(readOnly), readOnly,
containerName,
- valueStorageProvider, maxBufferSize, swapDirectory, swapCleaner);
- }
-
- return new SybaseSingleDbJDBCConnection(getJdbcConnection(readOnly), readOnly,
containerName,
- valueStorageProvider, maxBufferSize, swapDirectory, swapCleaner);
-
- }
- catch (SQLException e)
- {
- throw new RepositoryException(e);
- }
- }
+ return false;
+ }
}
Deleted:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SybaseMultiDbJDBCConnection.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SybaseMultiDbJDBCConnection.java 2011-02-11
15:41:56 UTC (rev 3969)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SybaseMultiDbJDBCConnection.java 2011-02-11
19:44:55 UTC (rev 3970)
@@ -1,97 +0,0 @@
-/*
- * Copyright (C) 2003-2010 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/>.
- */
-package org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.db;
-
-import org.exoplatform.services.jcr.impl.util.io.FileCleaner;
-import org.exoplatform.services.jcr.storage.value.ValueStoragePluginProvider;
-
-import java.io.File;
-import java.sql.Connection;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-
-/**
- * Created by The eXo Platform SAS.
- *
- * Date: 8 02 2011
- *
- * @author <a href="mailto:anatoliy.bazko@exoplatform.com.ua">Anatoliy
Bazko</a>
- * @version $Id: SybaseMultiDbJDBCConnection.java 34360 2010-11-11 11:11:11Z tolusha $
- */
-public class SybaseMultiDbJDBCConnection extends MultiDbJDBCConnection
-{
- /**
- * Sybase Multidatabase JDBC Connection constructor.
- *
- * @param dbConnection
- * JDBC connection, shoudl be opened before
- * @param readOnly
- * boolean if true the dbConnection was marked as READ-ONLY.
- * @param containerName
- * Workspace Storage Container name (see configuration)
- * @param valueStorageProvider
- * External Value Storages provider
- * @param maxBufferSize
- * Maximum buffer size (see configuration)
- * @param swapDirectory
- * Swap directory File (see configuration)
- * @param swapCleaner
- * Swap cleaner (internal FileCleaner).
- * @throws SQLException
- *
- * @see org.exoplatform.services.jcr.impl.util.io.FileCleaner
- */
- public SybaseMultiDbJDBCConnection(Connection dbConnection, boolean readOnly, String
containerName,
- ValueStoragePluginProvider valueStorageProvider, int maxBufferSize, File
swapDirectory, FileCleaner swapCleaner)
- throws SQLException
- {
- super(dbConnection, readOnly, containerName, valueStorageProvider, maxBufferSize,
swapDirectory, swapCleaner);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void prepareQueries() throws SQLException
- {
- super.prepareQueries();
- FIND_NODES_AND_PROPERTIES =
- "select J.*, P.ID AS P_ID, P.NAME AS P_NAME, P.VERSION AS P_VERSION,
P.P_TYPE, P.P_MULTIVALUED,"
- + " V.DATA, V.ORDER_NUM, V.STORAGE_DESC from JCR_MVALUE V, JCR_MITEM
P"
- + " join (select I.ID, I.PARENT_ID, I.NAME, I.VERSION, I.I_INDEX,
I.N_ORDER_NUM from JCR_MITEM I"
- + " where I.I_CLASS=1) J on P.PARENT_ID = J.ID"
- + " where P.I_CLASS=2 and V.PROPERTY_ID=P.ID order by J.ID";
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected ResultSet findNodesAndProperties(int offset, int limit) throws SQLException
- {
- if (findNodesAndProperties == null)
- {
- findNodesAndProperties =
dbConnection.prepareStatement(FIND_NODES_AND_PROPERTIES);
- }
- else
- {
- findNodesAndProperties.clearParameters();
- }
-
- return findNodesAndProperties.executeQuery();
- }
-}
Deleted:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SybaseSingleDbJDBCConnection.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SybaseSingleDbJDBCConnection.java 2011-02-11
15:41:56 UTC (rev 3969)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SybaseSingleDbJDBCConnection.java 2011-02-11
19:44:55 UTC (rev 3970)
@@ -1,100 +0,0 @@
-/*
- * Copyright (C) 2003-2010 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/>.
- */
-package org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.db;
-
-import org.exoplatform.services.jcr.impl.util.io.FileCleaner;
-import org.exoplatform.services.jcr.storage.value.ValueStoragePluginProvider;
-
-import java.io.File;
-import java.sql.Connection;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-
-/**
- * Created by The eXo Platform SAS.
- *
- * Date: 8 02 2011
- *
- * @author <a href="mailto:anatoliy.bazko@exoplatform.com.ua">Anatoliy
Bazko</a>
- * @version $Id: SybaseSingleDbJDBCConnection.java 34360 2010-11-11 11:11:11Z tolusha $
- */
-public class SybaseSingleDbJDBCConnection extends SingleDbJDBCConnection
-{
- /**
- * Sybase Singledatabase JDBC Connection constructor.
- *
- * @param dbConnection
- * JDBC connection, should be opened before
- * @param readOnly
- * boolean if true the dbConnection was marked as READ-ONLY.
- * @param containerName
- * Workspace Storage Container name (see configuration)
- * @param valueStorageProvider
- * External Value Storages provider
- * @param maxBufferSize
- * Maximum buffer size (see configuration)
- * @param swapDirectory
- * Swap directory File (see configuration)
- * @param swapCleaner
- * Swap cleaner (internal FileCleaner).
- * @throws SQLException
- *
- * @see org.exoplatform.services.jcr.impl.util.io.FileCleaner
- */
- public SybaseSingleDbJDBCConnection(Connection dbConnection, boolean readOnly, String
containerName,
- ValueStoragePluginProvider valueStorageProvider, int maxBufferSize, File
swapDirectory, FileCleaner swapCleaner)
- throws SQLException
- {
- super(dbConnection, readOnly, containerName, valueStorageProvider, maxBufferSize,
swapDirectory, swapCleaner);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void prepareQueries() throws SQLException
- {
- super.prepareQueries();
- FIND_NODES_AND_PROPERTIES =
- "select J.*, P.ID AS P_ID, P.NAME AS P_NAME, P.VERSION AS P_VERSION,
P.P_TYPE, P.P_MULTIVALUED,"
- + " V.DATA, V.ORDER_NUM, V.STORAGE_DESC from JCR_SVALUE V, JCR_SITEM
P"
- + " join (select I.ID, I.PARENT_ID, I.NAME, I.VERSION, I.I_INDEX,
I.N_ORDER_NUM from JCR_SITEM I"
- + " where I.CONTAINER_NAME=? AND I.I_CLASS=1) J on P.PARENT_ID =
J.ID"
- + " where P.I_CLASS=2 and P.CONTAINER_NAME=? and V.PROPERTY_ID=P.ID
order by J.ID";
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected ResultSet findNodesAndProperties(int offset, int limit) throws SQLException
- {
- if (findNodesAndProperties == null)
- {
- findNodesAndProperties =
dbConnection.prepareStatement(FIND_NODES_AND_PROPERTIES);
- }
- else
- {
- findNodesAndProperties.clearParameters();
- }
-
- findNodesAndProperties.setString(1, containerName);
- findNodesAndProperties.setString(4, containerName);
-
- return findNodesAndProperties.executeQuery();
- }
-}