#41579 [Opn->Fbk]: PDO timeout lost connection

From: Date: Mon, 04 Jun 2007 08:30:55 +0000
Subject: #41579 [Opn->Fbk]: PDO timeout lost connection
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-113321@lists.php.net to get a copy of this message
 ID:               41579
 Updated by:       tony2001@php.net
 Reported By:      vtsupermok at gmail dot com
-Status:           Open
+Status:           Feedback
 Bug Type:         PDO related
 Operating System: Window
 PHP Version:      5.2.3
 New Comment:

What exactly do I need to do in order to reproduce it?


Previous Comments:
------------------------------------------------------------------------

[2007-06-04 04:25:10] vtsupermok at gmail dot com

Description:
------------
I create a pdo object and set PDO::ATTR_PERSISTENT => true, after
serveral hours I run my programme again. Suppose the connection will be
timeout and then the program throw a PDOException. 

But the real situation is it said time out lost connection but it
wouldn't return a PDOException.

Reproduce code:
---------------
$db=array(
    'name'=>'abc',
    'host'=>'127.0.0.1',
    'port'=>'3306',
    'userID'=>'123',
    'userPwd'=>'123',
    'charset'=>'latin1',
    'encoding'=>'big-5'
);
 
try{
   
$database="mysql:host={$db['host']};port={$db['port']};dbname={$db['name']}";
    $pdo = new PDO($database, $db['userID'], $db['userPwd'],
array(PDO::ATTR_PERSISTENT => true));
} catch (PDOException $e) {
    throw $e;
}

Expected result:
----------------
throw a exception.

Actual result:
--------------
the mysql error is timeout lost connection but it would't throw a
exception


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=41579&edit=1


Thread (13 messages)

« previous php.bugs (#113321) next »