php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #66522 Ping functionality
Submitted: 2014-01-20 15:52 UTC Modified: 2021-06-09 10:53 UTC
Votes:4
Avg. Score:4.5 ± 0.5
Reproduced:4 of 4 (100.0%)
Same Version:3 (75.0%)
Same OS:3 (75.0%)
From: myselfasunder at gmail dot com Assigned:
Status: Open Package: PDO related
PHP Version: Irrelevant OS: Linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: myselfasunder at gmail dot com
New email:
PHP Version: OS:

 

 [2014-01-20 15:52 UTC] myselfasunder at gmail dot com
Description:
------------
There is a problem with persistent MySQL connections, wherein an abrupt, broken, persistent connection raises a "server has gone away" error. Using the original "mysql" or newer "mysqli" extensions, this can be mitigated by doing a "ping" (mysql_ping(), mysqli_ping(), ->ping()) before a query or other operation is attempted. If the connection is healthy, this is a trivial check similar to a standard heartbeat. If the connection has collapsed, it will be automatically reestablished using the original connection information.

Currently, PDO does not [obviously] support this. I am recommending that support for this functionality be added to PDO core, and implementations be added for each driver where supported, or be translated to a no-op for those that don't.



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-10-24 08:29 UTC] kalle@php.net
-Package: PDO Core +Package: PDO related
 [2021-06-09 10:53 UTC] cmb@php.net
I see no particular reason not to expose the check_liveness method
if already implemented by the driver.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 13 05:01:28 2024 UTC