logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mattsic...@apache.org
Subject svn commit: r1612984 - /logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcDatabaseManager.java
Date Thu, 24 Jul 2014 03:17:39 GMT
Author: mattsicker
Date: Thu Jul 24 03:17:39 2014
New Revision: 1612984

URL: http://svn.apache.org/r1612984
Log:
Revert commit for LOG4J2-734 JDBC batch updates.

Modified:
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcDatabaseManager.java

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcDatabaseManager.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcDatabaseManager.java?rev=1612984&r1=1612983&r2=1612984&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcDatabaseManager.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcDatabaseManager.java
Thu Jul 24 03:17:39 2014
@@ -18,7 +18,6 @@ package org.apache.logging.log4j.core.ap
 
 import java.io.StringReader;
 import java.sql.Connection;
-import java.sql.DatabaseMetaData;
 import java.sql.PreparedStatement;
 import java.sql.SQLException;
 import java.sql.Timestamp;
@@ -44,7 +43,6 @@ public final class JdbcDatabaseManager e
 
     private Connection connection;
     private PreparedStatement statement;
-    private boolean isBatchSupported;
 
     private JdbcDatabaseManager(final String name, final int bufferSize, final ConnectionSource
connectionSource,
                                 final String sqlStatement, final List<Column> columns)
{
@@ -55,11 +53,8 @@ public final class JdbcDatabaseManager e
     }
 
     @Override
-    protected void startupInternal() throws Exception {
-        this.connection = this.connectionSource.getConnection();
-        final DatabaseMetaData metaData = this.connection.getMetaData();
-        this.isBatchSupported = metaData.supportsBatchUpdates();
-        Closer.closeSilently(this.connection);
+    protected void startupInternal() {
+        // nothing to see here
     }
 
     @Override
@@ -114,9 +109,7 @@ public final class JdbcDatabaseManager e
                 }
             }
 
-            if (this.isBatchSupported) {
-                this.statement.addBatch();
-            } else if (this.statement.executeUpdate() == 0) {
+            if (this.statement.executeUpdate() == 0) {
                 throw new AppenderLoggingException(
                         "No records inserted in database table for log event in JDBC manager.");
             }
@@ -132,9 +125,6 @@ public final class JdbcDatabaseManager e
     protected void commitAndClose() {
         try {
             if (this.connection != null && !this.connection.isClosed()) {
-                if (this.isBatchSupported) {
-                    this.statement.executeBatch();
-                }
                 this.connection.commit();
             }
         } catch (final SQLException e) {



Mime
View raw message