Req #9662 [Opn->Fbk]: odbc_connect() can't create new connection if same credentials are given again
| From: | heiglandreas@php.net | Date: | Fri, 20 Jan 2017 17:02:49 +0000 |
| Subject: | Req #9662 [Opn->Fbk]: 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-206764@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=9662&edit=1
ID: 9662
Updated by: heiglandreas@php.net
Reported by: cpoirier at shelluser dot net
Summary: odbc_connect() can't create new connection if same
credentials are given again
-Status: Open
+Status: Feedback
Type: Feature/Change Request
Package: ODBC related
Operating System: *
PHP Version: *
Block user comment: N
Private report: N
New Comment:
Is still relevant?
Previous Comments:
------------------------------------------------------------------------
[2002-06-09 16:21:24] mfischer@php.net
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 . . .
------------------------------------------------------------------------
[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 at shelluser dot 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 https://bugs.php.net/bug.php?id=9662&edit=1