This commit is contained in:
2023-04-02 20:09:40 +08:00
parent 0f28608180
commit 735c077f46
+8 -1
View File
@@ -186,7 +186,14 @@ class Connection extends Component
*/
public function getPdo(): PDO
{
return $this->getMasterClient();
if (!Db::inTransactionsActive()) {
return $this->getMasterClient();
}
if (!Context::hasContext($this->cds)) {
return Context::setContext($this->cds, $this->getMasterClient());
} else {
return Context::getContext($this->cds);
}
}
/**