Skip to content

Commit e3a6caa

Browse files
committed
PHPLIB-473: Don't override readConcern when in a transaction
1 parent 39b740a commit e3a6caa

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ public function watch(array $pipeline = [], array $options = [])
313313

314314
$server = select_server($this->manager, $options);
315315

316-
if (! isset($options['readConcern']) && server_supports_feature($server, self::$wireVersionForReadConcern)) {
316+
if (! isset($options['readConcern']) && server_supports_feature($server, self::$wireVersionForReadConcern) && ! is_in_transaction($options)) {
317317
$options['readConcern'] = $this->readConcern;
318318
}
319319

src/Database.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ public function watch(array $pipeline = [], array $options = [])
511511

512512
$server = select_server($this->manager, $options);
513513

514-
if (! isset($options['readConcern']) && server_supports_feature($server, self::$wireVersionForReadConcern)) {
514+
if (! isset($options['readConcern']) && server_supports_feature($server, self::$wireVersionForReadConcern) && ! is_in_transaction($options)) {
515515
$options['readConcern'] = $this->readConcern;
516516
}
517517

0 commit comments

Comments
 (0)