This commit is contained in:
2021-03-05 14:55:50 +08:00
parent b61c209195
commit b959bd037d
10 changed files with 29 additions and 35 deletions
+2 -14
View File
@@ -223,23 +223,11 @@ class Connection extends Pool
/**
* batch release
* @throws Exception
*/
public function connection_clear()
{
$connections = Context::getAllContext();
foreach ($connections as $name => $connection) {
if (empty($connection) || !($connection instanceof PDO)) {
continue;
}
/** @var PDO $pdoClient */
if ($connection->inTransaction()) {
$connection->commit();
}
$this->push($name, $connection);
$this->remove($name);
}
$this->hasCreate = [];
$this->creates = 0;
$this->flush(0);
}