Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,6 @@ public <T> Mono<T> execute(final AsyncReadOperation<T> operation, final ReadPref
clientSessionHelper.withClientSession(session, this)
.map(clientSession -> getReadWriteBinding(getContext(subscriber),
readPreference, readConcern, clientSession, session == null))
// TODO (CSOT) - does this get called - can the above return empty?
.switchIfEmpty(Mono.fromCallable(() ->
getReadWriteBinding(getContext(subscriber),
readPreference, readConcern, session, false)))
.flatMap(binding -> {
if (session != null && session.hasActiveTransaction() && !binding.getReadPreference().equals(primary())) {
binding.release();
Expand Down Expand Up @@ -122,10 +118,6 @@ public <T> Mono<T> execute(final AsyncWriteOperation<T> operation, final ReadCon
clientSessionHelper.withClientSession(session, this)
.map(clientSession -> getReadWriteBinding(getContext(subscriber),
primary(), readConcern, clientSession, session == null))
// TODO (CSOT) - does this get called - can the above return empty?
.switchIfEmpty(Mono.fromCallable(() ->
getReadWriteBinding(getContext(subscriber), primary(),
readConcern, session, false)))
.flatMap(binding ->
Mono.<T>create(sink -> operation.executeAsync(binding, (result, t) -> {
try {
Expand Down