#32191 [Fbk->Opn]: Persistant Connection do not get revalidated on re-use and fail to reconnect
| From: | carstenklein at yahoo dot de | Date: | Fri, 04 Mar 2005 18:16:32 +0000 |
| Subject: | #32191 [Fbk->Opn]: Persistant Connection do not get revalidated on re-use and fail to reconnect | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-74848@lists.php.net to get a copy of this message | ||
ID: 32191
User updated by: carstenklein at yahoo dot de
Reported By: carstenklein at yahoo dot de
-Status: Feedback
+Status: Open
Bug Type: MySQL related
-Operating System: Any
+Operating System: Fedora Core 2
-PHP Version: Irrelevant
+PHP Version: Any (I believe)
New Comment:
Well, as I did find two other bug-reports correlating to the same issue
but with different database layers and for different operating systems
and PHP versions I rendered it irrelevant to post both version and
operating system. But here you go.
Previous Comments:
------------------------------------------------------------------------
[2005-03-04 16:21:56] sniper@php.net
There is not 'Irrelevant' PHP version or operating system called 'Any'.
Please fill those fields in this report properly.
------------------------------------------------------------------------
[2005-03-04 12:57:52] carstenklein at yahoo dot de
Description:
------------
I have developed a database access layer that tries to ensure that
proper result handling is provided for.
However, when using persistant connections I have the problem that
whenever the database service fails (due to intermediate shutdown or
other network related problems), the persistantly opened connection
link to the database service does not revalidate its connection and as
such will report a mysql_error() state of naught and as such it cannot
be determined exactly as to where the error stems from.
Reproduce code:
---------------
I will not post any line of source code here, just an indepth
explanation of how to reproduce:
start your mysql daemon.
open a persistant connection to the service.
do something with the connected and selected database.
shutdown the mysql daemon.
try to re-use the persistant connection using mysql_pconnect() and try
to send a query to the service.
The query will fail, but there will not be any result code given by
mysql_errno() that will provide any hint on the actual cause of the
failure.
Expected result:
----------------
My code should produce a DbConnectionFailure instead of simply an
DbUnexpectedFailure or DbUnknownFailure in case the persistant
connection to the database fails because of the database service being
no longer available.
Actual result:
--------------
DbUnknownFailure.
mysql_errno() fails to report error state.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=32191&edit=1