diff options
author | Eike Stepper | 2012-09-15 18:39:43 +0000 |
---|---|---|
committer | Eike Stepper | 2012-09-15 18:39:43 +0000 |
commit | 661d7d2e8bb433cfa71ce43e2a8c63e383930ca7 (patch) | |
tree | c4c3d285d9579f64b9342cf31f4a34903511aa7a /plugins/org.eclipse.net4j.db | |
parent | 2a3975c4861d26548f9dd802c574594d8b0c2abd (diff) | |
download | cdo-661d7d2e8bb433cfa71ce43e2a8c63e383930ca7.tar.gz cdo-661d7d2e8bb433cfa71ce43e2a8c63e383930ca7.tar.xz cdo-661d7d2e8bb433cfa71ce43e2a8c63e383930ca7.zip |
Avoid timeouts in writeLobs()
Diffstat (limited to 'plugins/org.eclipse.net4j.db')
-rw-r--r-- | plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/DBUtil.java | 22 |
1 files changed, 17 insertions, 5 deletions
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. * |