diff options
6 files changed, 38 insertions, 3 deletions
diff --git a/plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.master/config/cdo-server.xml b/plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.master/config/cdo-server.xml index e5cb7ddf62..67d08a070d 100644 --- a/plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.master/config/cdo-server.xml +++ b/plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.master/config/cdo-server.xml @@ -43,6 +43,10 @@ <property name="idColumnLength" value="34"/> --> + <!-- Example http://bugs.eclipse.org/493598 + <property name="jdbcFetchSize" value="10000"/> + --> + <!-- Period at which to execute an SQL statement to keep DB connection alive, in minutes --> <property name="connectionKeepAlivePeriod" value="60"/> @@ -52,6 +56,7 @@ <!-- Maximum number of store accessors (JDBC connections) to keep in the writer pool. The default value is 15. --> <property name="writerPoolCapacity" value="20"/> + <mappingStrategy type="horizontal"> <!-- callout --> <property name="qualifiedNames" value="true"/> <property name="withRanges" value="false"/> diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IDBStore.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IDBStore.java index ce5824880a..8e1fc00620 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IDBStore.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IDBStore.java @@ -61,6 +61,8 @@ public interface IDBStore extends IStore, IDBConnectionProvider, CanHandleClient */ public int getIDColumnLength(); + public int getJDBCFetchSize(); + /** * @since 4.2 */ @@ -138,5 +140,10 @@ public interface IDBStore extends IStore, IDBConnectionProvider, CanHandleClient * @since 4.4 */ public static final String DROP_ALL_DATA_ON_ACTIVATE = "dropAllDataOnActivate"; //$NON-NLS-1$ + + /** + * @since 4.1 + */ + public static final String JDBC_FETCH_SIZE = "jdbcFetchSize"; //$NON-NLS-1$ } } diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStore.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStore.java index 62322f5eb9..d5a314979b 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStore.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStore.java @@ -110,6 +110,8 @@ public class DBStore extends Store implements IDBStore, IMappingConstants, CDOAl private int idColumnLength = IDBField.DEFAULT; + private int jdbcFetchSize = 100000; + private IIDHandler idHandler; private IMetaDataManager metaDataManager = new MetaDataManager(this); @@ -190,6 +192,11 @@ public class DBStore extends Store implements IDBStore, IMappingConstants, CDOAl return properties; } + public int getJDBCFetchSize() + { + return jdbcFetchSize; + } + public int getIDColumnLength() { return idColumnLength; @@ -604,6 +611,12 @@ public class DBStore extends Store implements IDBStore, IMappingConstants, CDOAl { setDropAllDataOnActivate(Boolean.parseBoolean(prop)); } + + prop = properties.get(IDBStore.Props.JDBC_FETCH_SIZE); + if (prop != null) + { + jdbcFetchSize = Integer.parseInt(prop); + } } Connection connection = getConnection(); diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalAuditClassMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalAuditClassMapping.java index fb0e6adcf3..7caf42c3ff 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalAuditClassMapping.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/HorizontalAuditClassMapping.java @@ -686,12 +686,15 @@ public class HorizontalAuditClassMapping extends AbstractHorizontalClassMapping { DBStore store = (DBStore)getMappingStrategy().getStore(); InternalRepository repository = store.getRepository(); + CDOBranchPoint head = repository.getBranchManager().getMainBranch().getHead(); EClass eClass = getEClass(); long timeStamp = branchPoint.getTimeStamp(); IIDHandler idHandler = store.getIDHandler(); IDBPreparedStatement stmt = null; + + int jdbcFetchSize = store.getJDBCFetchSize(); int oldFetchSize = -1; final long start1 = TRACER_UNITS.isEnabled() ? System.currentTimeMillis() : CDOBranchPoint.UNSPECIFIED_DATE; @@ -707,7 +710,7 @@ public class HorizontalAuditClassMapping extends AbstractHorizontalClassMapping ConcurrencyUtil.execute(repository, listFiller); oldFetchSize = stmt.getFetchSize(); - stmt.setFetchSize(100000); + stmt.setFetchSize(jdbcFetchSize); IDBResultSet resultSet = stmt.executeQuery(); for (;;) diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/UnitMappingTable.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/UnitMappingTable.java index 02f03f57b7..48735012df 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/UnitMappingTable.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/UnitMappingTable.java @@ -137,6 +137,8 @@ public class UnitMappingTable extends Lifecycle implements IMappingConstants IDBConnection connection = accessor.getDBConnection(); IDBPreparedStatement stmt = connection.prepareStatement(SQL_SELECT_CLASSES, ReuseProbability.HIGH); + + int jdbcFetchSize = store.getJDBCFetchSize(); int oldFetchSize = -1; try @@ -144,7 +146,7 @@ public class UnitMappingTable extends Lifecycle implements IMappingConstants idHandler.setCDOID(stmt, 1, rootID); oldFetchSize = stmt.getFetchSize(); - stmt.setFetchSize(100000); + stmt.setFetchSize(jdbcFetchSize); ResultSet resultSet = stmt.executeQuery(); while (resultSet.next()) @@ -205,7 +207,7 @@ public class UnitMappingTable extends Lifecycle implements IMappingConstants private void initUnit(BatchedStatement stmt, IView view, CDOID rootID, CDORevisionHandler revisionHandler, Set<CDOID> initializedIDs, long timeStamp, IIDHandler idHandler, CDORevision revision, OMMonitor monitor) - throws SQLException + throws SQLException { revisionHandler.handleRevision(revision); diff --git a/plugins/org.eclipse.emf.cdo.server.product/config/cdo-server.xml b/plugins/org.eclipse.emf.cdo.server.product/config/cdo-server.xml index 9375996516..ac1d78fc63 100644 --- a/plugins/org.eclipse.emf.cdo.server.product/config/cdo-server.xml +++ b/plugins/org.eclipse.emf.cdo.server.product/config/cdo-server.xml @@ -43,6 +43,10 @@ <property name="idColumnLength" value="34"/> --> + <!-- Example http://bugs.eclipse.org/493598 + <property name="jdbcFetchSize" value="10000"/> + --> + <!-- Period at which to execute an SQL statement to keep DB connection alive, in minutes --> <property name="connectionKeepAlivePeriod" value="60"/> @@ -52,6 +56,7 @@ <!-- Maximum number of store accessors (JDBC connections) to keep in the writer pool. The default value is 15. --> <property name="writerPoolCapacity" value="20"/> + <mappingStrategy type="horizontal"> <!-- callout --> <property name="qualifiedNames" value="true"/> <property name="withRanges" value="false"/> |