Bug #3723: Cross-nested connect/close fails
| From: | sdelmont at loquesea dot com | Date: | Sat, 04 Mar 2000 00:59:14 +0000 |
| Subject: | Bug #3723: Cross-nested connect/close fails | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-16381@lists.php.net to get a copy of this message | ||
From: sdelmont@loquesea.com
Operating system: Win2000 Pro
PHP version: 3.0.15
PHP Bug Type: ODBC related
Bug description: Cross-nested connect/close fails
Cross-nested connections to the same ODBC Source fails.
It seems the first odbc_close() closes all other connections to the same DSN.
This works OK... (Correctly nested)
$A = odbc_connect( DSN );
$B = odbc_connect( DSN );
odbc_exec( $A );
odbc_exec( $B );
odbc_close( $B );
odbc_close( $A );
This works OK... (Non nested)
$A = odbc_connect( DSN );
odbc_exec( $A );
odbc_close( $A );
$B = odbc_connect( DSN );
odbc_exec( $B );
odbc_close( $B );
This works FAILS... (Cross-nested)
$A = odbc_connect( DSN );
$B = odbc_connect( DSN );
odbc_exec( $A );
odbc_close( $A );
odbc_exec( $B );
odbc_close( $B );
Warning: Bad ODBC connection number (1) in xxxx.php on line [line number for 'odbc_exec( $B
);']
Using different DSNs works... even if the two DSNs point to the same database.
I tested it using PHP 3.0.15 and 4 beta 4, using JET (Access) and MSSQL.
This is a serious problem if you use ODBC for PHPLIB, which doesn't close its connections, and
use the same DSN elsewhere on your code.
The only workaround seems to either use a separate DSN for PHPLIB and other queries, or change
PHPLIB so it closes the database connections after page_open and reopens it at page_close