Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2012-09-15 18:39:43 +0000
committerEike Stepper2012-09-15 18:39:43 +0000
commit661d7d2e8bb433cfa71ce43e2a8c63e383930ca7 (patch)
treec4c3d285d9579f64b9342cf31f4a34903511aa7a /plugins
parent2a3975c4861d26548f9dd802c574594d8b0c2abd (diff)
downloadcdo-661d7d2e8bb433cfa71ce43e2a8c63e383930ca7.tar.gz
cdo-661d7d2e8bb433cfa71ce43e2a8c63e383930ca7.tar.xz
cdo-661d7d2e8bb433cfa71ce43e2a8c63e383930ca7.zip
Avoid timeouts in writeLobs()
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/ObjectTypeTable.java28
-rw-r--r--plugins/org.eclipse.emf.cdo.server/CDOServer.launch4
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/StoreAccessor.java13
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/IDE.launch2
-rw-r--r--plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/DBUtil.java22
5 files changed, 55 insertions, 14 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/ObjectTypeTable.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/ObjectTypeTable.java
index f087120de1..882561e070 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/ObjectTypeTable.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/ObjectTypeTable.java
@@ -77,12 +77,21 @@ public class ObjectTypeTable extends AbstractObjectTypeMapper
{
stmt = statementCache.getPreparedStatement(sqlSelect, ReuseProbability.MAX);
idHandler.setCDOID(stmt, 1, id);
- DBUtil.trace(stmt.toString());
+
+ if (DBUtil.isTracerEnabled())
+ {
+ DBUtil.trace(stmt.toString());
+ }
+
ResultSet resultSet = stmt.executeQuery();
if (!resultSet.next())
{
- DBUtil.trace("ClassID for CDOID " + id + " not found"); //$NON-NLS-1$ //$NON-NLS-2$
+ if (DBUtil.isTracerEnabled())
+ {
+ DBUtil.trace("ClassID for CDOID " + id + " not found"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
return null;
}
@@ -113,7 +122,12 @@ public class ObjectTypeTable extends AbstractObjectTypeMapper
idHandler.setCDOID(stmt, 1, id);
idHandler.setCDOID(stmt, 2, getMetaDataManager().getMetaID(type, timeStamp));
stmt.setLong(3, timeStamp);
- DBUtil.trace(stmt.toString());
+
+ if (DBUtil.isTracerEnabled())
+ {
+ DBUtil.trace(stmt.toString());
+ }
+
int result = stmt.executeUpdate();
if (result != 1)
@@ -145,9 +159,13 @@ public class ObjectTypeTable extends AbstractObjectTypeMapper
{
stmt = statementCache.getPreparedStatement(sqlDelete, ReuseProbability.MAX);
idHandler.setCDOID(stmt, 1, id);
- DBUtil.trace(stmt.toString());
- int result = stmt.executeUpdate();
+ if (DBUtil.isTracerEnabled())
+ {
+ DBUtil.trace(stmt.toString());
+ }
+
+ int result = stmt.executeUpdate();
if (result != 1)
{
throw new DBException("Object type could not be deleted: " + id); //$NON-NLS-1$
diff --git a/plugins/org.eclipse.emf.cdo.server/CDOServer.launch b/plugins/org.eclipse.emf.cdo.server/CDOServer.launch
index 30daddd115..c3a8dfc467 100644
--- a/plugins/org.eclipse.emf.cdo.server/CDOServer.launch
+++ b/plugins/org.eclipse.emf.cdo.server/CDOServer.launch
@@ -29,11 +29,11 @@
<stringAttribute key="pde.version" value="3.3"/>
<stringAttribute key="product" value="org.eclipse.platform.ide"/>
<stringAttribute key="selectedPlugin" value="org.eclipse.emf.cdo"/>
-<stringAttribute key="selected_target_plugins" value="com.mysql.jdbc*5.1.11.201205201951@default:default,org.apache.derby@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.expressions@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.core.runtime@default:true,org.eclipse.emf.common*2.8.0.v20120516-0416@default:default,org.eclipse.emf.ecore*2.8.0.v20120516-0416@default:default,org.eclipse.emf.ecore.change*2.8.0.v20120516-0416@default:default,org.eclipse.emf.ecore.xmi*2.8.0.v20120516-0416@default:default,org.eclipse.equinox.app@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.orbit.mongodb@default:default,org.eclipse.osgi@-1:true,org.h2@default:default,org.hsqldb@default:default,org.postgresql.jdbc3@default:default"/>
+<stringAttribute key="selected_target_plugins" value="com.mysql.jdbc@default:default,org.apache.derby@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.expressions@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.core.runtime@default:true,org.eclipse.emf.common@default:default,org.eclipse.emf.ecore.change@default:default,org.eclipse.emf.ecore.xmi@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.equinox.app@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.orbit.mongodb@default:default,org.eclipse.osgi@-1:true,org.h2@default:default,org.hsqldb@default:default,org.postgresql.jdbc3@default:default"/>
<stringAttribute key="selected_workspace_plugins" value="org.eclipse.emf.cdo.common@default:default,org.eclipse.emf.cdo.examples.company@default:default,org.eclipse.emf.cdo.net4j@default:default,org.eclipse.emf.cdo.security@default:default,org.eclipse.emf.cdo.server.admin@default:default,org.eclipse.emf.cdo.server.db@default:default,org.eclipse.emf.cdo.server.mongodb@default:default,org.eclipse.emf.cdo.server.net4j@default:default,org.eclipse.emf.cdo.server.security@default:default,org.eclipse.emf.cdo.server@default:default,org.eclipse.emf.cdo@default:default,org.eclipse.net4j.db.derby@default:default,org.eclipse.net4j.db.h2@default:default,org.eclipse.net4j.db.hsqldb@default:default,org.eclipse.net4j.db.mysql@default:default,org.eclipse.net4j.db.postgresql@default:default,org.eclipse.net4j.db@default:default,org.eclipse.net4j.jvm@default:default,org.eclipse.net4j.tcp@default:default,org.eclipse.net4j.util@default:default,org.eclipse.net4j@default:default"/>
<booleanAttribute key="show_selected_only" value="false"/>
<stringAttribute key="templateConfig" value="${target_home}\configuration\config.ini"/>
-<booleanAttribute key="tracing" value="true"/>
+<booleanAttribute key="tracing" value="false"/>
<mapAttribute key="tracingOptions">
<mapEntry key="org.eclipse.core.contenttype/debug" value="false"/>
<mapEntry key="org.eclipse.core.expressions/tracePropertyResolving" value="false"/>
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/StoreAccessor.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/StoreAccessor.java
index f188544ea1..5a2462d469 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/StoreAccessor.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/StoreAccessor.java
@@ -26,6 +26,7 @@ import org.eclipse.net4j.util.WrappedException;
import org.eclipse.net4j.util.io.ExtendedDataInputStream;
import org.eclipse.net4j.util.io.LimitedInputStream;
import org.eclipse.net4j.util.om.monitor.OMMonitor;
+import org.eclipse.net4j.util.om.monitor.OMMonitor.Async;
import java.io.IOException;
import java.io.InputStream;
@@ -74,7 +75,7 @@ public abstract class StoreAccessor extends StoreAccessorBase
try
{
- monitor.begin(1 + newPackageUnits.length + 2 + newObjects.length + detachedObjects.length + dirtyCount);
+ monitor.begin(1 + newPackageUnits.length + 2 + newObjects.length + detachedObjects.length + dirtyCount + 1);
writeCommitInfo(branch, timeStamp, previousTimeStamp, userID, commitComment, monitor.fork());
if (newPackageUnits.length != 0)
@@ -115,6 +116,8 @@ public abstract class StoreAccessor extends StoreAccessorBase
ExtendedDataInputStream in = context.getLobs();
if (in != null)
{
+ Async async = monitor.forkAsync();
+
try
{
int count = in.readInt();
@@ -136,6 +139,14 @@ public abstract class StoreAccessor extends StoreAccessorBase
{
throw WrappedException.wrap(ex);
}
+ finally
+ {
+ async.stop();
+ }
+ }
+ else
+ {
+ monitor.worked();
}
}
finally
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/IDE.launch b/plugins/org.eclipse.emf.cdo.ui.ide/IDE.launch
index 3ee004379e..7832d817eb 100644
--- a/plugins/org.eclipse.emf.cdo.ui.ide/IDE.launch
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/IDE.launch
@@ -24,7 +24,7 @@
<stringAttribute key="selected_workspace_plugins" value="org.eclipse.emf.cdo.ui@default:default,org.eclipse.net4j.util@default:default,org.eclipse.emf.cdo.ui.ide@default:default,org.eclipse.emf.cdo.team@default:default,org.eclipse.net4j.tcp@default:default,org.eclipse.emf.cdo.tests.model1@default:default,org.eclipse.net4j.util.ui@default:default,org.eclipse.emf.cdo.common@default:default,org.eclipse.emf.cdo@default:default,org.eclipse.emf.cdo.tests.model1.edit@default:default,org.eclipse.emf.cdo.doc@default:default,org.eclipse.net4j@default:default,org.eclipse.net4j.jms.api@default:default,org.eclipse.emf.cdo.edit@default:default"/>
<booleanAttribute key="show_selected_only" value="false"/>
<stringAttribute key="templateConfig" value="${target_home}\configuration\config.ini"/>
-<booleanAttribute key="tracing" value="true"/>
+<booleanAttribute key="tracing" value="false"/>
<mapAttribute key="tracingOptions">
<mapEntry key="org.eclipse.core.contenttype/debug" value="false"/>
<mapEntry key="org.eclipse.core.expressions/tracePropertyResolving" value="false"/>
diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/DBUtil.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/DBUtil.java
index edc959474f..4466729a44 100644
--- a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/DBUtil.java
+++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/DBUtil.java
@@ -351,17 +351,17 @@ public final class DBUtil
{
Connection conn = null;
Statement stmt = null;
-
+
try
{
conn = dataSource.getConnection();
stmt = conn.createStatement();
-
+
if (dropIfExists)
{
stmt.execute("DROP SCHEMA IF EXISTS " + name);
}
-
+
stmt.execute("CREATE SCHEMA IF NOT EXISTS " + name);
}
catch (SQLException ex)
@@ -627,7 +627,11 @@ public final class DBUtil
*/
public static int update(PreparedStatement stmt, boolean exactlyOne) throws SQLException
{
- trace(stmt.toString());
+ if (DBUtil.isTracerEnabled())
+ {
+ trace(stmt.toString());
+ }
+
int result = stmt.executeUpdate();
// basic check of update result
@@ -1072,7 +1076,7 @@ public final class DBUtil
*/
public static String trace(String sql)
{
- if (TRACER.isEnabled())
+ if (isTracerEnabled())
{
TRACER.trace(sql);
}
@@ -1081,6 +1085,14 @@ public final class DBUtil
}
/**
+ * @since 4.2
+ */
+ public static boolean isTracerEnabled()
+ {
+ return TRACER.isEnabled();
+ }
+
+ /**
* Call-back interface with a {@link #done(boolean) method} that is called <i>after</i>
* a number of table rows have been handled by one of the subtypes of this interface.
*

Back to the top