Req #64603 [NEW]: missing function to close persistent connection

From: Date: Sun, 07 Apr 2013 07:11:12 +0000
Subject: Req #64603 [NEW]: missing function to close persistent connection
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-178336@lists.php.net to get a copy of this message
From:             slavb18 at gmail dot com
Operating system: Any
PHP version:      5.3.23
Package:          PDO related
Bug Type:         Feature/Change Request
Bug description:missing function to close persistent connection

Description:
------------
PHP PDO class is missing ability to close persistent connection:
__destruct does not close it, even if I call
setAttribute(PDO::ATTR_PERSISTENT,FALSE) before destruction
May be __destruct should analyze PDO::ATTR_PERSISTENT attribute or there
should be explicit function to close persistent connection.

Need to close invalid (shutdown) peristent connection demonstrate example
below:

Example with firebird:
1. establish persistent connect in php
2. shutdown connection on server
3. try to get persistent connect from php again
there will be error "General error: -902 connection shutdown"

I can check connection validity in my pdo derived class like this:
	public function isValid(){
		$valid=TRUE;
		try {
			$this->beginTransaction();
			$this->commit();
		} catch (PDOException $e){
			$valid=FALSE;
		}
		return $valid;
	}

but I can not "refresh" or "close" my broken connection, there is no
function to free it in php connection pool


-- 
Edit bug report at https://bugs.php.net/bug.php?id=64603&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=64603&r=trysnapshot54
Try a snapshot (PHP 5.3):   https://bugs.php.net/fix.php?id=64603&r=trysnapshot53
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=64603&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=64603&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=64603&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=64603&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=64603&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=64603&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=64603&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=64603&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=64603&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=64603&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=64603&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64603&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=64603&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=64603&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=64603&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=64603&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=64603&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=64603&r=mysqlcfg



Thread (7 messages)

« previous php.bugs (#178336) next »