Commit f3094ec7 authored by Jeremy Mikola's avatar Jeremy Mikola

PHPLIB-368: Remove redundant check for RC within transaction

Aggregate::execute() already checks for this. This also adds a note in CollectionFunctionalTest that watch() is prohibited within a transaction, as is done for other methods.
parent d8d95110
......@@ -213,11 +213,6 @@ class Watch implements Executable, /* @internal */ CommandSubscriber
*/
public function execute(Server $server)
{
$inTransaction = isset($this->options['session']) && $this->options['session']->isInTransaction();
if ($inTransaction && isset($this->options['readConcern'])) {
throw UnsupportedException::readConcernNotSupportedInTransaction();
}
return new ChangeStream($this->executeAggregate($server), $this->resumeCallable);
}
......
......@@ -551,6 +551,17 @@ class CollectionFunctionalTest extends FunctionalTestCase
);
}, 'w'
],
/* Disabled, as it's illegal to use change streams in transactions
[
function($collection, $session, $options = []) {
$collection->watch(
[],
['session' => $session] + $options
);
}, 'r'
],
*/
];
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment