Bug #9662 Updated: odbc_connect() acts like odbc_pconnect()

From: Date: Sun, 09 Jun 2002 20:12:08 +0000
Subject: Bug #9662 Updated: odbc_connect() acts like odbc_pconnect()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-9949@lists.php.net to get a copy of this message
ID: 9662 Updated by: kalowsky@php.net Reported By: cpoirier@shelluser.net -Status: Open +Status: Analyzed Bug Type: ODBC related Operating System: Windows 98 PHP Version: 4.0.4pl1 New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#9949) next »