Edit report at https://bugs.php.net/bug.php?id=64603&edit=1

 ID:                 64603
 User updated by:    slavb18 at gmail dot com
 Reported by:        slavb18 at gmail dot com
 Summary:            missing function to close persistent connection
 Status:             Open
 Type:               Feature/Change Request
 Package:            PDO related
 Operating System:   Any
 PHP Version:        5.3.23
 Block user comment: N
 Private report:     N

 New Comment:

there is similiar Bug #40681 with oracle


Previous Comments:
------------------------------------------------------------------------
[2013-04-07 07:11:12] slavb18 at gmail dot com

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 this bug report at https://bugs.php.net/bug.php?id=64603&edit=1

Reply via email to