Bug #9662 Updated: odbc_connect() can't create new connection if same credentials are given again
| From: | mfischer@php.net | Date: | Sun, 09 Jun 2002 20:21:24 +0000 |
| Subject: | Bug #9662 Updated: odbc_connect() can't create new connection if same credentials are given again | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-9951@lists.php.net to get a copy of this message | ||
ID: 9662
Updated by: mfischer@php.net
-Summary: odbc_connect() acts like odbc_pconnect()
Reported By: cpoirier@shelluser.net
-Status: Analyzed
+Status: Open
-Bug Type: ODBC related
+Bug Type: Feature/Change Request
-Operating System: Windows 98
+Operating System: Windows
-PHP Version: 4.0.4pl1
+PHP Version: CVS
New Comment:
Updated summery, version, OS, making a feature request, reopening.
Mysql is the only extension having this. It would be very nice if
before 4.3 gets release we have this for *every* db extension finally .
. .
Previous Comments:
------------------------------------------------------------------------
[2002-06-09 16:12:06] kalowsky@php.net
Well this is true. The connection option should have an option to
create/force a new connection really, but it doesn't. Currently if you
make two connections with the same information, you'll only receive the
handle back of the first connection (to save on the connection
pooling). Makes sense in 99% of cases... but you should also be using
a "start transaction" and "end transaction" statement in sql to ensure
transaction management, and that would be based upon a SQL statement,
not a connection handle.
Not sure if I'd really classify this as a bug, but I'll leave it open
because it would be a nice to change the behavior of.
------------------------------------------------------------------------
[2001-03-09 13:44:37] cpoirier@shelluser.net
I think this may be intentional -- there was a comment that could have
been to that effect in the code. However, it has the side effect of
breaking transaction management. The code here is an approximation of
the results that I was seeing -- I don't guarantee it will run, but
you'll get the idea...
<?php
$connection1 = odbc_connect( "X", "", "" );
$connection2 = odbc_connect( "X", "", "" );
odbc_exec( $connection1, "insert into Table values (1) );
odbc_exec( $connection2, "insert into Table values (2) );
odbc_commit( $connection1 );
odbc_rollback( $connection2 );
odbc_close( $connection1 );
odbc_close( $connection2 );
?>
Table contains rows:
1
2
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=9662&edit=1