@@ -84,10 +84,6 @@ public <T> Mono<T> execute(final AsyncReadOperation<T> operation, final ReadPref
84
84
clientSessionHelper .withClientSession (session , this )
85
85
.map (clientSession -> getReadWriteBinding (getContext (subscriber ),
86
86
readPreference , readConcern , clientSession , session == null ))
87
- // TODO (CSOT) - does this get called - can the above return empty?
88
- .switchIfEmpty (Mono .fromCallable (() ->
89
- getReadWriteBinding (getContext (subscriber ),
90
- readPreference , readConcern , session , false )))
91
87
.flatMap (binding -> {
92
88
if (session != null && session .hasActiveTransaction () && !binding .getReadPreference ().equals (primary ())) {
93
89
binding .release ();
@@ -122,10 +118,6 @@ public <T> Mono<T> execute(final AsyncWriteOperation<T> operation, final ReadCon
122
118
clientSessionHelper .withClientSession (session , this )
123
119
.map (clientSession -> getReadWriteBinding (getContext (subscriber ),
124
120
primary (), readConcern , clientSession , session == null ))
125
- // TODO (CSOT) - does this get called - can the above return empty?
126
- .switchIfEmpty (Mono .fromCallable (() ->
127
- getReadWriteBinding (getContext (subscriber ), primary (),
128
- readConcern , session , false )))
129
121
.flatMap (binding ->
130
122
Mono .<T >create (sink -> operation .executeAsync (binding , (result , t ) -> {
131
123
try {
0 commit comments