Skip to content

Commit

Permalink
give the operation a default timeout of infinite, just like statements
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbae committed Oct 25, 2018
1 parent 4f1c5bd commit f9e6ea6
Showing 1 changed file with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2003,11 +2003,9 @@ public int[] executeBatch() throws SQLServerException, BatchUpdateException, SQL
}

SQLServerBulkCopy bcOperation = new SQLServerBulkCopy(connection);
if (queryTimeout > 0) {
SQLServerBulkCopyOptions option = new SQLServerBulkCopyOptions();
option.setBulkCopyTimeout(queryTimeout);
bcOperation.setBulkCopyOptions(option);
}
SQLServerBulkCopyOptions option = new SQLServerBulkCopyOptions();
option.setBulkCopyTimeout(queryTimeout);
bcOperation.setBulkCopyOptions(option);
bcOperation.setDestinationTableName(tableName);
bcOperation.setStmtColumnEncriptionSetting(this.getStmtColumnEncriptionSetting());
bcOperation.setDestinationTableMetadata(rs);
Expand Down Expand Up @@ -2162,11 +2160,9 @@ public long[] executeLargeBatch() throws SQLServerException, BatchUpdateExceptio
}

SQLServerBulkCopy bcOperation = new SQLServerBulkCopy(connection);
if (queryTimeout > 0) {
SQLServerBulkCopyOptions option = new SQLServerBulkCopyOptions();
option.setBulkCopyTimeout(queryTimeout);
bcOperation.setBulkCopyOptions(option);
}
SQLServerBulkCopyOptions option = new SQLServerBulkCopyOptions();
option.setBulkCopyTimeout(queryTimeout);
bcOperation.setBulkCopyOptions(option);
bcOperation.setDestinationTableName(tableName);
bcOperation.setStmtColumnEncriptionSetting(this.getStmtColumnEncriptionSetting());
bcOperation.setDestinationTableMetadata(rs);
Expand Down

0 comments on commit f9e6ea6

Please sign in to comment.