php.net |  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
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!

Patches

Pull Requests

History

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-2024 The PHP Group
All rights reserved.
Last updated: Tue Dec 10 21:01:27 2024 UTC