Skip to content

Commit

Permalink
respect the statement's timeout time if it is set.
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbae committed Oct 1, 2018
1 parent 709342f commit 4f1c5bd
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2003,6 +2003,11 @@ 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);
}
bcOperation.setDestinationTableName(tableName);
bcOperation.setStmtColumnEncriptionSetting(this.getStmtColumnEncriptionSetting());
bcOperation.setDestinationTableMetadata(rs);
Expand Down Expand Up @@ -2157,6 +2162,11 @@ public long[] executeLargeBatch() throws SQLServerException, BatchUpdateExceptio
}

SQLServerBulkCopy bcOperation = new SQLServerBulkCopy(connection);
if (queryTimeout > 0) {
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 4f1c5bd

Please sign in to comment.