You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's no simple way to do this in PDO. Documentation suggests:
To close the connection, you need to destroy the object by ensuring that all remaining references to it are deleted—you do this by assigning null to the variable that holds the object.
Note: If there are still other references to this PDO instance (such as from a PDOStatement instance, or from other variables referencing the same PDO instance), these have to be removed also (for instance, by assigning null to the variable that references the PDOStatement).
publicfunctionclose()
{
// this line does the jobtry { $this->pdo->query('KILL CONNECTION_ID()'); } catch (\PDOException$e) {}
// this should close the connection, but doesn't.return$this->pdo = $this->connection = $this->container = $this->pdoStatement = null;
}
try/catch to dismiss Fatal error: 1317 Query execution was interrupted
May be someone can do it correctly with nulls to make it more cleaner.
But it tested and works with this mysql trick.
Can pixie close a connection? It's not in the documentation..
The text was updated successfully, but these errors were encountered: