Commit 426e5ae 1 parent 3b4f0a2 commit 426e5ae Copy full SHA for 426e5ae
File tree 1 file changed +20
-1
lines changed
src/main/java/com/microsoft/sqlserver/jdbc
1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -3351,14 +3351,33 @@ final byte[] getTransactionDescriptor() {
3351
3351
3352
3352
@ Override
3353
3353
public void commit () throws SQLServerException {
3354
+ commit (false );
3355
+ }
3356
+
3357
+ /**
3358
+ * Makes all changes made since the previous
3359
+ * commit/rollback permanent and releases any database locks
3360
+ * currently held by this <code>Connection</code> object.
3361
+ * This method should be
3362
+ * used only when auto-commit mode has been disabled.
3363
+ *
3364
+ * @param delayedDurability flag to indicate whether the commit will occur with delayed durability on.
3365
+ * @throws SQLServerException Exception if a database access error occurs,
3366
+ */
3367
+ public void commit (boolean delayedDurability ) throws SQLServerException {
3354
3368
loggerExternal .entering (loggingClassName , "commit" );
3355
3369
if (loggerExternal .isLoggable (Level .FINER ) && Util .isActivityTraceOn ()) {
3356
3370
loggerExternal .finer (toString () + " ActivityId: " + ActivityCorrelator .getNext ().toString ());
3357
3371
}
3358
3372
3359
3373
checkClosed ();
3360
3374
if (!databaseAutoCommitMode )
3361
- connectionCommand ("IF @@TRANCOUNT > 0 COMMIT TRAN" , "Connection.commit" );
3375
+ {
3376
+ if (!delayedDurability )
3377
+ connectionCommand ("IF @@TRANCOUNT > 0 COMMIT TRAN" , "Connection.commit" );
3378
+ else
3379
+ connectionCommand ("IF @@TRANCOUNT > 0 COMMIT TRAN WITH ( DELAYED_DURABILITY = ON )" , "Connection.commit" );
3380
+ }
3362
3381
loggerExternal .exiting (loggingClassName , "commit" );
3363
3382
}
3364
3383
You can’t perform that action at this time.
0 commit comments