@@ -83,6 +83,7 @@ public class SessionPoolOptions {
8383
8484 // TODO: Change to use java.time.Duration.
8585 private final Duration multiplexedSessionMaintenanceDuration ;
86+ private final boolean skipVerifyingBeginTransactionForMuxRW ;
8687
8788 private SessionPoolOptions (Builder builder ) {
8889 // minSessions > maxSessions is only possible if the user has only set a value for maxSessions.
@@ -132,6 +133,7 @@ private SessionPoolOptions(Builder builder) {
132133 ? useMultiplexedSessionFromEnvVariablePartitionedOps
133134 : builder .useMultiplexedSessionPartitionedOps ;
134135 this .multiplexedSessionMaintenanceDuration = builder .multiplexedSessionMaintenanceDuration ;
136+ this .skipVerifyingBeginTransactionForMuxRW = builder .skipVerifyingBeginTransactionForMuxRW ;
135137 }
136138
137139 @ Override
@@ -169,8 +171,10 @@ public boolean equals(Object o) {
169171 && Objects .equals (this .useMultiplexedSession , other .useMultiplexedSession )
170172 && Objects .equals (this .useMultiplexedSessionForRW , other .useMultiplexedSessionForRW )
171173 && Objects .equals (
172- this .multiplexedSessionMaintenanceDuration ,
173- other .multiplexedSessionMaintenanceDuration );
174+ this .multiplexedSessionMaintenanceDuration , other .multiplexedSessionMaintenanceDuration )
175+ && Objects .equals (
176+ this .skipVerifyingBeginTransactionForMuxRW ,
177+ other .skipVerifyingBeginTransactionForMuxRW );
174178 }
175179
176180 @ Override
@@ -199,7 +203,8 @@ public int hashCode() {
199203 this .poolMaintainerClock ,
200204 this .useMultiplexedSession ,
201205 this .useMultiplexedSessionForRW ,
202- this .multiplexedSessionMaintenanceDuration );
206+ this .multiplexedSessionMaintenanceDuration ,
207+ this .skipVerifyingBeginTransactionForMuxRW );
203208 }
204209
205210 public Builder toBuilder () {
@@ -390,6 +395,12 @@ Duration getMultiplexedSessionMaintenanceDuration() {
390395 return multiplexedSessionMaintenanceDuration ;
391396 }
392397
398+ @ VisibleForTesting
399+ @ InternalApi
400+ boolean getSkipVerifyBeginTransactionForMuxRW () {
401+ return skipVerifyingBeginTransactionForMuxRW ;
402+ }
403+
393404 public static Builder newBuilder () {
394405 return new Builder ();
395406 }
@@ -605,6 +616,7 @@ public static class Builder {
605616
606617 private Duration multiplexedSessionMaintenanceDuration = Duration .ofDays (7 );
607618 private Clock poolMaintainerClock = Clock .INSTANCE ;
619+ private boolean skipVerifyingBeginTransactionForMuxRW = false ;
608620
609621 private static Position getReleaseToPositionFromSystemProperty () {
610622 // NOTE: This System property is a beta feature. Support for it can be removed in the future.
@@ -648,6 +660,7 @@ private Builder(SessionPoolOptions options) {
648660 this .useMultiplexedSessionPartitionedOps = options .useMultiplexedSessionForPartitionedOps ;
649661 this .multiplexedSessionMaintenanceDuration = options .multiplexedSessionMaintenanceDuration ;
650662 this .poolMaintainerClock = options .poolMaintainerClock ;
663+ this .skipVerifyingBeginTransactionForMuxRW = options .skipVerifyingBeginTransactionForMuxRW ;
651664 }
652665
653666 /**
@@ -870,6 +883,13 @@ Builder setMultiplexedSessionMaintenanceDuration(
870883 return this ;
871884 }
872885
886+ @ VisibleForTesting
887+ Builder setSkipVerifyingBeginTransactionForMuxRW (
888+ boolean skipVerifyingBeginTransactionForMuxRW ) {
889+ this .skipVerifyingBeginTransactionForMuxRW = skipVerifyingBeginTransactionForMuxRW ;
890+ return this ;
891+ }
892+
873893 /**
874894 * Sets whether the client should automatically execute a background query to detect the dialect
875895 * that is used by the database or not. Set this option to true if you do not know what the
0 commit comments