php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #6083 odbc_pconnect($dbu, $dbp, []) will not generate a new ID on the same dbuser!
Submitted: 2000-08-10 17:20 UTC Modified: 2000-08-10 18:52 UTC
From: oo at tedas dot de Assigned:
Status: Closed Package: ODBC related
PHP Version: 4.0.0 OS: Linux & WinNT
Private report: No CVE-ID: None
 [2000-08-10 17:20 UTC] oo at tedas dot de
SkriptA.php contains:
   $conn = odbc_pconnect($dbuser1, $dbpwd1, []);
SkriptB.php contains:
   $conn = odbc_pconnect($dbuser1, $dbpwd1, []);
... and will generate the same CONNECT_ID preventing from having several transactions by several persistant CONNECT_IDs on a database for the same user. 
odbc_connect has the same malfunction in one script. This "bug" - wanted or not - is implemented in the C++ - Code of PHP in, I think, "odbc_do_connect" or similar. Please check out the problem and tell me the reason of it.

THANKS

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-08-10 18:52 UTC] kara@php.net
You are addressing two different issues:
1. You cannot open two sessions for the same user/database in a single script.
2. You cannot resume a session and it's pending transactions between two HTTP requests.

Ad 1:
The idea behind persistent connection is to reuse connections - if you really need two separate transactions for one user in a single script, you could get this by setting ODBC Options different in odbc_connect() to get two connections. Or you could create two users. 

Ad 2:
AFAIK, it is impossible with ODBC to resume a particular session between two scripts while keeping the connection open, and it has to remain open to not end the transaction.
(with Oracle 8i it could theoretically be possible because of a distinction between connection to a server and a user session)
This would be possible in a threaded Webserver - but as it is today, each thread (or with Apache each process) has its own set of persistent connections - and it is impossible to direct a HTTP request to a specific thread/process.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 19 20:01:30 2024 UTC