Bug #51989 [Fbk->Opn]: PDO class doesn't connect but reuse open connections
| From: | nospam at unclassified dot de | Date: | Fri, 04 Jun 2010 07:41:34 +0000 |
| Subject: | Bug #51989 [Fbk->Opn]: PDO class doesn't connect but reuse open connections | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-151083@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=51989&edit=1
ID: 51989
User updated by: nospam at unclassified dot de
Reported by: nospam at unclassified dot de
Summary: PDO class doesn't connect but reuse open connections
-Status: Feedback
+Status: Open
Type: Bug
Package: *Database Functions
Operating System: Windows
PHP Version: 5.3.2
New Comment:
Sorry, a script that creates databases and such and also reproduces the
bug in
under 20 lines of code? That's impossible.
Previous Comments:
------------------------------------------------------------------------
[2010-06-04 09:38:53] mike@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves.
A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external
resources such as databases, etc. If the script requires a
database to demonstrate the issue, please make sure it creates
all necessary tables, stored procedures etc.
Please avoid embedding huge scripts into the report.
------------------------------------------------------------------------
[2010-06-03 14:43:58] nospam at unclassified dot de
Description:
------------
The manual says that the PDO class represents a database connection.
Thus I assume that when I instantiate two PDO classes, I get two
database connections. But instead, when using the same connection data,
I do not get a second connection but the first connection is simply
reused. I need a separate connection for logging purposes, it cannot use
the primary connection that's affected by transactions and all such
things.
I do get a separate connection when I connect to "127.0.0.1" instead of
"localhost", which is a different string but the same meaning. This is a
hack though because there are very limited alternatives to define the
same host.
Expected result:
----------------
I expect every PDO instance to actually give me a new connection, at
least when another connection is already in use.
Actual result:
--------------
It gives me the old connection that is used for transactions and such.
My programme doesn't work then. It needs another connection.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=51989&edit=1