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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: soenke at jimdo dot com
New email:
PHP Version: OS:

 

 [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-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 03:01:32 2024 UTC