Skip to content

Commit 0f08eba

Browse files
committed
Update name for bulk copy batchSize option
1 parent fee3149 commit 0f08eba

File tree

10 files changed

+72
-72
lines changed

10 files changed

+72
-72
lines changed

src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerConnection.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -549,19 +549,19 @@ CallableStatement prepareCall(String sql, int nType, int nConcur, int nHold,
549549
boolean getcacheBulkCopyMetadata();
550550

551551
/**
552-
* Specifies the default batch size for bulk copy operations.
552+
* Specifies the default batch size for bulk copy operations created from batch insert operations.
553553
*
554-
* @param bulkCopyOptionDefaultsBatchSize
555-
* integer value for bulkCopyOptionDefaultsBatchSize.
554+
* @param bulkCopyForBatchInsertBatchSize
555+
* integer value for bulkCopyForBatchInsertBatchSize.
556556
*/
557-
void setBulkCopyOptionDefaultsBatchSize(int bulkCopyOptionDefaultsBatchSize);
557+
void setBulkCopyForBatchInsertBatchSize(int bulkCopyForBatchInsertBatchSize);
558558

559559
/**
560-
* Returns the default batch size for bulk copy operations.
560+
* Returns the default batch size for bulk copy operations created from batch insert operations.
561561
*
562-
* @return integer value for bulkCopyOptionDefaultsBatchSize.
562+
* @return integer value for bulkCopyForBatchInsertBatchSize.
563563
*/
564-
int getBulkCopyOptionDefaultsBatchSize();
564+
int getBulkCopyForBatchInsertBatchSize();
565565

566566
/**
567567
* Specifies the default timeout for bulk copy operations.

src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerDataSource.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -981,19 +981,19 @@ public interface ISQLServerDataSource extends javax.sql.CommonDataSource {
981981
void setUseBulkCopyForBatchInsert(boolean useBulkCopyForBatchInsert);
982982

983983
/**
984-
* Sets the default batch size for Bulk Copy operations.
984+
* Sets the default batch size for bulk copy operations created from batch insert operations.
985985
*
986-
* @param bulkCopyOptionDefaultsBatchSize
987-
* the default batch size for Bulk Copy operations.
986+
* @param bulkCopyForBatchInsertBatchSize
987+
* the default batch size for bulk copy operations created from batch insert operations.
988988
*/
989-
void setBulkCopyOptionDefaultsBatchSize(int bulkCopyOptionDefaultsBatchSize);
989+
void setBulkCopyForBatchInsertBatchSize(int bulkCopyForBatchInsertBatchSize);
990990

991991
/**
992-
* Returns the default batch size for Bulk Copy operations.
992+
* Returns the default batch size for bulk copy operations created from batch insert operations.
993993
*
994-
* @return the default batch size for Bulk Copy operations.
994+
* @return the default batch size for bulk copy operations created from batch insert operations.
995995
*/
996-
int getBulkCopyOptionDefaultsBatchSize();
996+
int getBulkCopyForBatchInsertBatchSize();
997997

998998
/**
999999
* Sets the default timeout for Bulk Copy operations.

src/main/java/com/microsoft/sqlserver/jdbc/SQLServerBulkCopyOptions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public SQLServerBulkCopyOptions() {
108108
* Constructs a SQLServerBulkCopySettings class using defaults from given connection
109109
*/
110110
SQLServerBulkCopyOptions(SQLServerConnection conn) {
111-
batchSize = conn.getBulkCopyOptionDefaultsBatchSize();
111+
batchSize = conn.getBulkCopyForBatchInsertBatchSize();
112112
bulkCopyTimeout = conn.getBulkCopyOptionDefaultsTimeout();
113113
checkConstraints = conn.getBulkCopyOptionDefaultsCheckConstraints();
114114
fireTriggers = conn.getBulkCopyOptionDefaultsFireTriggers();

src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -856,27 +856,27 @@ public void setUseBulkCopyForBatchInsert(boolean useBulkCopyForBatchInsert) {
856856
}
857857

858858
/**
859-
* The default batch size for bulk copy operations.
859+
* The default batch size for bulk copy operations created from batch insert operations.
860860
*/
861-
private int bulkCopyOptionDefaultsBatchSize = 0;
861+
private int bulkCopyForBatchInsertBatchSize = 0;
862862

863863
/**
864-
* Returns the bulkCopyOptionDefaultsBatchSize value.
864+
* Returns the bulkCopyForBatchInsertBatchSize value.
865865
*
866-
* @return the bulkCopyOptionDefaultsBatchSize value.
866+
* @return the bulkCopyForBatchInsertBatchSize value.
867867
*/
868-
public int getBulkCopyOptionDefaultsBatchSize() {
869-
return bulkCopyOptionDefaultsBatchSize;
868+
public int getBulkCopyForBatchInsertBatchSize() {
869+
return bulkCopyForBatchInsertBatchSize;
870870
}
871871

872872
/**
873-
* Sets the bulkCopyOptionDefaultsBatchSize value.
873+
* Sets the bulkCopyForBatchInsertBatchSize value.
874874
*
875-
* @param bulkCopyOptionDefaultsBatchSize
876-
* the bulkCopyOptionDefaultsBatchSize value to set.
875+
* @param bulkCopyForBatchInsertBatchSize
876+
* the bulkCopyForBatchInsertBatchSize value to set.
877877
*/
878-
public void setBulkCopyOptionDefaultsBatchSize(int bulkCopyOptionDefaultsBatchSize) {
879-
this.bulkCopyOptionDefaultsBatchSize = bulkCopyOptionDefaultsBatchSize;
878+
public void setBulkCopyForBatchInsertBatchSize(int bulkCopyForBatchInsertBatchSize) {
879+
this.bulkCopyForBatchInsertBatchSize = bulkCopyForBatchInsertBatchSize;
880880
}
881881

882882
/**
@@ -3336,10 +3336,10 @@ else if (0 == requestedPacketSize)
33363336
useBulkCopyForBatchInsert = isBooleanPropertyOn(sPropKey, sPropValue);
33373337
}
33383338

3339-
sPropKey = SQLServerDriverIntProperty.BULK_COPY_OPTION_DEFAULTS_BATCH_SIZE.toString();
3339+
sPropKey = SQLServerDriverIntProperty.BULK_COPY_FOR_BATCH_INSERT_BATCH_SIZE.toString();
33403340
sPropValue = activeConnectionProperties.getProperty(sPropKey);
33413341
if (null != sPropValue) {
3342-
bulkCopyOptionDefaultsBatchSize = Integer.parseInt(sPropValue);
3342+
bulkCopyForBatchInsertBatchSize = Integer.parseInt(sPropValue);
33433343
}
33443344

33453345
sPropKey = SQLServerDriverIntProperty.BULK_COPY_OPTION_DEFAULTS_TIMEOUT.toString();
@@ -7901,8 +7901,8 @@ public <T> T unwrap(Class<T> iface) throws SQLException {
79017901
/** original useBulkCopyForBatchInsert flag */
79027902
private boolean originalUseBulkCopyForBatchInsert;
79037903

7904-
/** original bulkCopyOptionDefaultsBatchSize */
7905-
private int originalBulkCopyOptionDefaultsBatchSize;
7904+
/** original bulkCopyForBatchInsertBatchSize */
7905+
private int originalBulkCopyForBatchInsertBatchSize;
79067906

79077907
/** original bulkCopyOptionDefaultsTimeout */
79087908
private int originalBulkCopyOptionDefaultsTimeout;
@@ -7963,7 +7963,7 @@ void beginRequestInternal() throws SQLException {
79637963
originalEnablePrepareOnFirstPreparedStatementCall = getEnablePrepareOnFirstPreparedStatementCall();
79647964
originalSCatalog = sCatalog;
79657965
originalUseBulkCopyForBatchInsert = getUseBulkCopyForBatchInsert();
7966-
originalBulkCopyOptionDefaultsBatchSize = getBulkCopyOptionDefaultsBatchSize();
7966+
originalBulkCopyForBatchInsertBatchSize = getBulkCopyForBatchInsertBatchSize();
79677967
originalBulkCopyOptionDefaultsTimeout = getBulkCopyOptionDefaultsTimeout();
79687968
originalBulkCopyOptionDefaultsCheckConstraints = getBulkCopyOptionDefaultsCheckConstraints();
79697969
originalBulkCopyOptionDefaultsFireTriggers = getBulkCopyOptionDefaultsFireTriggers();
@@ -8034,8 +8034,8 @@ void endRequestInternal() throws SQLException {
80348034
setUseBulkCopyForBatchInsert(originalUseBulkCopyForBatchInsert);
80358035
}
80368036

8037-
if (getBulkCopyOptionDefaultsBatchSize() != originalBulkCopyOptionDefaultsBatchSize) {
8038-
setBulkCopyOptionDefaultsBatchSize(originalBulkCopyOptionDefaultsBatchSize);
8037+
if (getBulkCopyForBatchInsertBatchSize() != originalBulkCopyForBatchInsertBatchSize) {
8038+
setBulkCopyForBatchInsertBatchSize(originalBulkCopyForBatchInsertBatchSize);
80398039
}
80408040

80418041
if (getBulkCopyOptionDefaultsTimeout() != originalBulkCopyOptionDefaultsTimeout) {

src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnectionPoolProxy.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -755,27 +755,27 @@ public void setUseBulkCopyForBatchInsert(boolean useBulkCopyForBatchInsert) {
755755
}
756756

757757
/**
758-
* The default batch size for bulk copy operations.
758+
* The default batch size for bulk copy operations created from batch insert operations.
759759
*/
760-
private int bulkCopyOptionDefaultsBatchSize = 0;
760+
private int bulkCopyForBatchInsertBatchSize = 0;
761761

762762
/**
763-
* Returns the bulkCopyOptionDefaultsBatchSize value.
763+
* Returns the bulkCopyForBatchInsertBatchSize value.
764764
*
765-
* @return the bulkCopyOptionDefaultsBatchSize value.
765+
* @return the bulkCopyForBatchInsertBatchSize value.
766766
*/
767-
public int getBulkCopyOptionDefaultsBatchSize() {
768-
return wrappedConnection.getBulkCopyOptionDefaultsBatchSize();
767+
public int getBulkCopyForBatchInsertBatchSize() {
768+
return wrappedConnection.getBulkCopyForBatchInsertBatchSize();
769769
}
770770

771771
/**
772-
* Sets the bulkCopyOptionDefaultsBatchSize value.
772+
* Sets the bulkCopyForBatchInsertBatchSize value.
773773
*
774-
* @param bulkCopyOptionDefaultsBatchSize
775-
* the bulkCopyOptionDefaultsBatchSize value to set.
774+
* @param bulkCopyForBatchInsertBatchSize
775+
* the bulkCopyForBatchInsertBatchSize value to set.
776776
*/
777-
public void setBulkCopyOptionDefaultsBatchSize(int bulkCopyOptionDefaultsBatchSize) {
778-
wrappedConnection.setBulkCopyOptionDefaultsBatchSize(bulkCopyOptionDefaultsBatchSize);
777+
public void setBulkCopyForBatchInsertBatchSize(int bulkCopyForBatchInsertBatchSize) {
778+
wrappedConnection.setBulkCopyForBatchInsertBatchSize(bulkCopyForBatchInsertBatchSize);
779779
}
780780

781781
/**

src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDataSource.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,16 +1026,16 @@ public boolean getUseBulkCopyForBatchInsert() {
10261026
}
10271027

10281028
@Override
1029-
public void setBulkCopyOptionDefaultsBatchSize(int bulkCopyOptionDefaultsBatchSize) {
1030-
setIntProperty(connectionProps, SQLServerDriverIntProperty.BULK_COPY_OPTION_DEFAULTS_BATCH_SIZE.toString(),
1031-
bulkCopyOptionDefaultsBatchSize);
1029+
public void setBulkCopyForBatchInsertBatchSize(int bulkCopyForBatchInsertBatchSize) {
1030+
setIntProperty(connectionProps, SQLServerDriverIntProperty.BULK_COPY_FOR_BATCH_INSERT_BATCH_SIZE.toString(),
1031+
bulkCopyForBatchInsertBatchSize);
10321032
}
10331033

10341034
@Override
1035-
public int getBulkCopyOptionDefaultsBatchSize() {
1035+
public int getBulkCopyForBatchInsertBatchSize() {
10361036
return getIntProperty(connectionProps,
1037-
SQLServerDriverIntProperty.BULK_COPY_OPTION_DEFAULTS_BATCH_SIZE.toString(),
1038-
SQLServerDriverIntProperty.BULK_COPY_OPTION_DEFAULTS_BATCH_SIZE.getDefaultValue());
1037+
SQLServerDriverIntProperty.BULK_COPY_FOR_BATCH_INSERT_BATCH_SIZE.toString(),
1038+
SQLServerDriverIntProperty.BULK_COPY_FOR_BATCH_INSERT_BATCH_SIZE.getDefaultValue());
10391039
}
10401040

10411041
@Override

src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDriver.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ enum SQLServerDriverIntProperty {
645645
CANCEL_QUERY_TIMEOUT("cancelQueryTimeout", -1),
646646
CONNECT_RETRY_COUNT("connectRetryCount", 1, 0, 255),
647647
CONNECT_RETRY_INTERVAL("connectRetryInterval", 10, 1, 60),
648-
BULK_COPY_OPTION_DEFAULTS_BATCH_SIZE("bulkCopyOptionDefaultsBatchSize", 0),
648+
BULK_COPY_FOR_BATCH_INSERT_BATCH_SIZE("bulkCopyForBatchInsertBatchSize", 0),
649649
BULK_COPY_OPTION_DEFAULTS_TIMEOUT("bulkCopyOptionDefaultsTimeout", 60);
650650

651651
private final String name;
@@ -955,8 +955,8 @@ static String getAppName() {
955955
new SQLServerDriverPropertyInfo(SQLServerDriverBooleanProperty.USE_BULK_COPY_FOR_BATCH_INSERT.toString(),
956956
Boolean.toString(SQLServerDriverBooleanProperty.USE_BULK_COPY_FOR_BATCH_INSERT.getDefaultValue()),
957957
false, TRUE_FALSE),
958-
new SQLServerDriverPropertyInfo(SQLServerDriverIntProperty.BULK_COPY_OPTION_DEFAULTS_BATCH_SIZE.toString(),
959-
Integer.toString(SQLServerDriverIntProperty.BULK_COPY_OPTION_DEFAULTS_BATCH_SIZE.getDefaultValue()),false, null),
958+
new SQLServerDriverPropertyInfo(SQLServerDriverIntProperty.BULK_COPY_FOR_BATCH_INSERT_BATCH_SIZE.toString(),
959+
Integer.toString(SQLServerDriverIntProperty.BULK_COPY_FOR_BATCH_INSERT_BATCH_SIZE.getDefaultValue()),false, null),
960960
new SQLServerDriverPropertyInfo(SQLServerDriverIntProperty.BULK_COPY_OPTION_DEFAULTS_TIMEOUT.toString(),
961961
Integer.toString(SQLServerDriverIntProperty.BULK_COPY_OPTION_DEFAULTS_TIMEOUT.getDefaultValue()),false, null),
962962
new SQLServerDriverPropertyInfo(SQLServerDriverBooleanProperty.BULK_COPY_OPTION_DEFAULTS_CHECK_CONSTRAINTS.toString(),

src/main/java/com/microsoft/sqlserver/jdbc/SQLServerResource.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ protected Object[][] getContents() {
466466
{"R_cancelQueryTimeoutPropertyDescription", "The number of seconds to wait to cancel sending a query timeout."},
467467
{"R_invalidCancelQueryTimeout", "The cancel timeout value {0} is not valid."},
468468
{"R_useBulkCopyForBatchInsertPropertyDescription", "Determines whether the driver will use bulk copy API for batch insert operations."},
469-
{"R_bulkCopyOptionDefaultsBatchSizePropertyDescription", "The default batch size for bulk copy operations."},
469+
{"R_bulkCopyForBatchInsertBatchSizePropertyDescription", "The default batch size for bulk copy operations created from batch insert operations."},
470470
{"R_bulkCopyOptionDefaultsTimeoutPropertyDescription", "The default timeout for bulk copy operations."},
471471
{"R_bulkCopyOptionDefaultsCheckConstraintsPropertyDescription", "Determines whether to check constraints during bulk copy operations."},
472472
{"R_bulkCopyOptionDefaultsFireTriggersPropertyDescription", "Determines whether to fire triggers during bulk copy operations."},

0 commit comments

Comments
 (0)