note 116073 added to pdo.connections
| From: | Anonymous | Date: | Thu, 06 Nov 2014 07:14:50 +0000 |
| Subject: | note 116073 added to pdo.connections | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-200797@lists.php.net to get a copy of this message | ||
The comment http://php.net/manual/en/pdo.connections.php#114822
makes a very valid point. When we use the suggested method of dropping the connection by doing:
<?php
$pdo = null;
?>
The connection doesn't get dropped as described in the documentation. You may run into the
issue when running too many unit tests (it's never too many, though), resulting in PostgreSQL
hitting the connection limit after 150's test. The workaround is to use gc_collect_cycles()
after unsetting the $pdo.
<?php
$pdo = null;
gc_collect_cycles()
?>
The relevant bug is reported here http://bugs.php.net/bug.php?id=68360, upvote if you
care.
----
Server IP: 72.52.91.14
Probable Submitter: 62.106.104.22
----
Manual Page -- http://php.net/manual/en/pdo.connections.php
Edit -- https://master.php.net/note/edit/116073
Del: integrated -- https://master.php.net/note/delete/116073/integrated
Del: useless -- https://master.php.net/note/delete/116073/useless
Del: bad code -- https://master.php.net/note/delete/116073/bad+code
Del: spam -- https://master.php.net/note/delete/116073/spam
Del: non-english -- https://master.php.net/note/delete/116073/non-english
Del: in docs -- https://master.php.net/note/delete/116073/in+docs
Del: other reasons-- https://master.php.net/note/delete/116073
Reject -- https://master.php.net/note/reject/116073
Search -- https://master.php.net/manage/user-notes.php