ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seanfi...@apache.org
Subject svn commit: r1857285 - in /ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cc/jdbc/table: AbstractJdbcTable.java AbstractUmlsTable.java
Date Wed, 10 Apr 2019 21:26:17 GMT
Author: seanfinan
Date: Wed Apr 10 21:26:17 2019
New Revision: 1857285

URL: http://svn.apache.org/viewvc?rev=1857285&view=rev
Log:
add row to batch.

Modified:
    ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cc/jdbc/table/AbstractJdbcTable.java
    ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cc/jdbc/table/AbstractUmlsTable.java

Modified: ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cc/jdbc/table/AbstractJdbcTable.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cc/jdbc/table/AbstractJdbcTable.java?rev=1857285&r1=1857284&r2=1857285&view=diff
==============================================================================
--- ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cc/jdbc/table/AbstractJdbcTable.java
(original)
+++ ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cc/jdbc/table/AbstractJdbcTable.java
Wed Apr 10 21:26:17 2019
@@ -63,11 +63,14 @@ abstract public class AbstractJdbcTable<
     * @return true if the statement batch was written.
     * @throws SQLException -
     */
-   protected boolean incrementBatchIndex() throws SQLException {
+   protected boolean writeRow() throws SQLException {
+      final PreparedStatement statement = getPreparedStatement();
+      statement.addBatch();
       _batchIndex++;
       if ( _batchIndex >= _batchLimit ) {
          _batchIndex = 0;
-         getPreparedStatement().executeBatch();
+         statement.executeBatch();
+         statement.clearBatch();
          return true;
       }
       return false;

Modified: ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cc/jdbc/table/AbstractUmlsTable.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cc/jdbc/table/AbstractUmlsTable.java?rev=1857285&r1=1857284&r2=1857285&view=diff
==============================================================================
--- ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cc/jdbc/table/AbstractUmlsTable.java
(original)
+++ ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/cc/jdbc/table/AbstractUmlsTable.java
Wed Apr 10 21:26:17 2019
@@ -93,12 +93,13 @@ abstract public class AbstractUmlsTable<
          }
          for ( UmlsConcept concept : umlsConcepts ) {
             row.addToStatement( statement, concept );
-            batchWritten = incrementBatchIndex();
+            batchWritten = writeRow();
          }
       }
       if ( !batchWritten ) {
          // The current batch has not been written to db.  Do so now.
-         getPreparedStatement().executeBatch();
+         statement.executeBatch();
+         statement.clearBatch();
       }
    }
 



Mime
View raw message