php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #42901 Add a flag to PDO_mysql for reconnection in case of timeouts
Submitted: 2007-10-09 13:45 UTC Modified: 2011-04-18 14:16 UTC
From: soenke at jimdo dot com Assigned: mysql (profile)
Status: Wont fix Package: MySQL related
PHP Version: 5.2.4 OS: Irrelevant
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
32 + 18 = ?
Subscribe to this entry?

 
 [2007-10-09 13:45 UTC] soenke at jimdo dot com
Description:
------------
For long-running PHP script with database connections it would be nice if the database driver automatically reconnects in case of a server/network timeout.

This could be integrated with a reconnect flag for PDO. 

At least in libmysqlclient >= 5.0.13 MYSQL_OPT_RECONNECT is available.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-10-09 13:50 UTC] soenke at jimdo dot com
Here is working code from lighttpd mod_mysql_vhost:

http://trac.lighttpd.net/trac/browser/branches/lighttpd-1.4.x/src/mod_mysql_vhost.c?rev=1965
 [2011-01-01 23:55 UTC] jani@php.net
-Package: Feature/Change Request +Package: MySQL related
 [2011-01-06 16:20 UTC] uw@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: mysql
 [2011-04-18 14:16 UTC] johannes@php.net
-Status: Assigned +Status: Wont fix
 [2011-04-18 14:16 UTC] johannes@php.net
Doing this in the driver level means that your application will "suddenly" loose its state (transactions, temp table, session vars, probably including encoding settings, ...) this is fine for vhost configuration as there's not much state, in an application it's better to do it inside an database wrapper and react properly.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Oct 25 05:03:32 2021 UTC