Bug #9496 Updated: Mixing non persistant and persistant connection makes all connexions persistant

From: Date: Fri, 15 Jun 2001 07:53:55 +0000
Subject: Bug #9496 Updated: Mixing non persistant and persistant connection makes all connexions persistant
Groups: php.dev 
Request: Send a blank email to php-dev+get-56722@lists.php.net to get a copy of this message
ID: 9496 User Update by: jean-francois.gosset@telintrans.fr Status: Closed Bug Type: OCI8 related Operating system: linux red hat 6.2 PHP Version: 4.0.4pl1 Description: Mixing non persistant and persistant connection makes all connexions persistant I think this behaviour is confusing. One can have the needs to mix persistant and non persistant connexion on the same database. In my case, I want to validate an account with a personal username and after use a generic account. The first one must not be persistant because we would have too much connexions open. Previous Comments: --------------------------------------------------------------------------- [2001-05-04 10:44:07] thies@php.net OCIPlogon() will do the same as OCILogon() but mark the sever and session handle as persistent, which means that PHP won't close them on script-end. if your script does a OCILogon("s","t") and later a OCIPLogon("s","t") _no_ new server or session handle will be created but instead the existing ones will be marked persistent. this is intended behaviour - why would we want to change it? --------------------------------------------------------------------------- [2001-02-28 08:33:16] jean-francois.gosset@telintrans.fr With the following test (test_oci8.php) both connexions (USER_1 and USER_2) are persistant. Notes : 1. We can see that connexions are persistant with the following SQL command : select username, status, logon_time from v$session where username='USER_1' or username='USER_2'; 2. We can use the following workaround : use a different database name for USER_1 and USER_2 (who acces the same real database). 3. If we invert the order of connexions (USER_2 before USER_1) and use OCInlogon for USER_1, only USER_2 has persistant connexions but the number of connexions of USER_2 increase until to reach the maximum limit (ORA-00604 error). ------------------------------- test_oci8.php ------------------------------- <html> <title>OCI8 bug test</title> </head> <body> <% $user = "USER_1"; $password = "pwd1"; $database = "TEST"; { // should be non persistent !!!! $connexion = OCIlogon ( $user, $password, $database); if (!$connexion) { trigger_error ( "Erreur OCIlogon $user / $database", E_USER_ERROR); } else { echo "<p>Connexion 1 OK"; } OCIlogoff ($connexion); } { $user = "USER_2"; $password = "pwd2"; $database = "TEST"; // If we use a different databasename (for the same real database) we don't have the problem // $database = "TEST2"; $connexion = OCIplogon ( $user, $password, $database); if (!$connexion) { trigger_error ( "Erreur OCIplogon $user / $database", E_USER_ERROR); } else { echo "<p>Connexion 2 OK"; } OCIlogoff ($connexion); } %> </body> </html> ------------------------------- --------------------------------------------------------------------------- Full Bug description available at: http://bugs.php.net/?id=9496

« previous php.dev (#56722) next »