|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1090 Sybase persistent connections can't handle server restart
Submitted: 1999-01-24 04:46 UTC Modified: 1999-03-01 13:32 UTC
From: ryan at sunsetd dot com Assigned:
Status: Closed Package: Sybase-ct (ctlib) related
PHP Version: 3.0.6 OS: RedHat Linux 5.2 w/ 2.2.0-pre7 k
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.
Block user comment
Status: Assign to:
Bug Type:
From: ryan at sunsetd dot com
New email:
PHP Version: OS:


 [1999-01-24 04:46 UTC] ryan at sunsetd dot com
When PHP uses persistent Sybase connections (not sure about other databases), it can get into trouble if the server shuts down or restarts.  PHP thinks the connection is still live (even though the socket is closed and CT-Lib reports that the connection isn't live anymore), and sybase_pconnect() continues to return a previous persistent connection without reopening a new CT-Lib session..  Not a real high-priority bug, but makes life interesting if you have to restart Sybase on a busy server, or if Sybase goes down (requiring a restart of Apache on all PHP machines that connect to the database).  Other than that, PHP really kicks ass for rapid web database development with Sybase support!


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [1999-03-01 13:32 UTC] tommay
I put in a pile of code for 3.0.6 to deal with this because our piece
of crap databases crap out all the time.  The way it's intended to
work now is that sybase_pconnection() will not return a known bad
connection.  However, the connection it will return is also not known
to still be good.  If the database is restarted or the machine it's
running on is rebooted it will return a connection that will fail, but
that connection will be marked dead and will not be returned again.
Trying to guess whether the connection is known good is unreliable
because there's always a race where the connection may be good when it
is returned but the database may go down soon afterwards.  You always
need error recovery code in your php script.

I'm closing this because the functionality described above works satisfactorily
for me when the database is restarted or its host is rebooted.

If somebody can suggest a specific way to do something better, please do.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Mon Oct 03 08:05:54 2022 UTC