File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
src/main/java/oracle/r2dbc/impl Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -569,9 +569,7 @@ public Publisher<Void> rollbackTransactionToSavepoint(String name) {
569569 @ Override
570570 public Publisher <Void > setAutoCommit (boolean autoCommit ) {
571571 requireOpenConnection (jdbcConnection );
572- // TODO: Replace defer with AsyncLock.get(...). It will defer execution
573- // until a subscriber subscribes.
574- return Mono .defer (() -> fromJdbc (() -> {
572+ return Mono .from (adapter .getLock ().flatMap (() -> {
575573 if (autoCommit == jdbcConnection .getAutoCommit ()) {
576574 return Mono .empty (); // No change
577575 }
@@ -585,7 +583,7 @@ else if (! autoCommit) {
585583 // Changing auto-commit from disabled to enabled. Commit in case
586584 // there is an active transaction.
587585 return Mono .from (commitTransaction ())
588- .doOnSuccess ( nil -> runJdbc (() ->
586+ .concatWith ( adapter . getLock (). run (() ->
589587 jdbcConnection .setAutoCommit (true )));
590588 }
591589 }))
You can’t perform that action at this time.
0 commit comments