php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #16704 Screwed up handles while connection multiple DBs
Submitted: 2002-04-19 15:10 UTC Modified: 2002-05-01 14:09 UTC
Votes:7
Avg. Score:5.0 ± 0.0
Reproduced:5 of 5 (100.0%)
Same Version:4 (80.0%)
Same OS:3 (60.0%)
From: thomas dot hoppe at daimlerchrysler-bank dot com Assigned:
Status: Closed Package: OCI8 related
PHP Version: 4.1.2 OS: Windows 2000
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: thomas dot hoppe at daimlerchrysler-bank dot com
New email:
PHP Version: OS:

 

 [2002-04-19 15:10 UTC] thomas dot hoppe at daimlerchrysler-bank dot com
I would like to report a problem and ask for help with php 4.0.6 and Oracle 8 Support.

When you try to use more than one connection, the last connection
created is the one that receives every statement.

I found a workaround but I'm not quite sure if it really works everytime (not enough testing yet):

You could do the following for each connections and somehow they are available
after that:

for ($i=1; $i <= 2; $i++)
{
$oci_connection_new = OCILogon  ($oracle_user, $oracle_pass, $oracle_inst);  
}

I reviewed $oci_connection_new and figured out thata it changes the recource id after the loop

Thomas

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-04-19 21:08 UTC] mfischer@php.net
Which version is it now? In the Report field you write 4.1.2, but in the body you write 4.0.6

In the latter case, please test a newer version first (even 4.2.0rc4 from php.net/~derick if possible).
 [2002-04-20 16:57 UTC] thomas dot hoppe at daimlerchrysler-bank dot com
Hi, thanx for your fast reply!

The true version is 4.0.6. I selected 4.1.2 as there was no better choice.

I have an aitional Note: Exactly the same problem existed for Informix AND Mysql:

http://bugs.php.net/bug.php?id=15628

The mysql one cane be found also here.

I browsed through all OCI8 related bugs but I couldn't find this bug, so I considered it is still existing in 4.1.2.

Antoher problem: I also tried to read the changelogs but why the hell are there no changelogs in new releases??

updating of 4.0.2rcx is really risky as it is aproduction environment.

Do you think this problem is really gone?
 [2002-04-20 17:35 UTC] mfischer@php.net
Can't comment on "if it's gone".

Do you mean that in all connection you establish you use the same username/passwort/host (or sid) in your context?
 [2002-04-21 07:37 UTC] thomas dot hoppe at daimlerchrysler-bank dot com
Hi,

Well thats an important point with the connections, I forgot it - sorry.

I'm using for each connection a different username, password and instance/sid.
The aim is to have during each script-run two connections. I call a function which generates a $oci_connection and $oci_connection_adm at the beginning of each script. Both connections are used several times and at the end of the script a logoff on both is commited.

If I do not the workaround that I've described, PHP isn't capable of distinguish between both conns - tha last one 'wins'.

If we had a changelog, we could review if there were any cchanges regarding the oci stuff between 4.0.6 and 4.1.2!

cu
 [2002-04-22 11:55 UTC] thomas dot hoppe at daimlerchrysler-bank dot com
Update:

One piece of information was wrong: I use always the same instance/SID name. But now I've even tried to create a alias for my instance that both conns get a different instance without success.

After digging deeper into the problem I've figured out a really easy way to see the bug:

1.) Create connection one $con1
2.) echo it out echo $con1 -> you get Resource id # 1
3.) Create connection two $con2
4.) echo it out echo $con2 -> you get Resource id # 2
5.) echo out connection one $con1 -> you get Resource id # 1

You see even the connection handles reflect the reality.

cu
 [2002-04-22 13:53 UTC] thomas dot hoppe at daimlerchrysler-bank dot com
Bah! Bug in bug report:

5.) echo out connection one $con1 -> you get Resource id # 2
                                                    _______^
 [2002-04-22 13:55 UTC] thies@php.net
 use OCINlogon to force session isolation. 
 
 [2002-04-22 14:06 UTC] thmas dot hoppe at daimlerchrysler-bank dot com
I also tried OCINLogon, but there was no difference.

Addition: As the documentation implies: it should be no problem for any OCI*logon function to make more than one connections!
 [2002-04-22 14:45 UTC] thies@php.net
please send me a shot _selfcontained_ php script that 
shows and explains your problem! 
 
 [2002-04-23 03:19 UTC] thomas dot hoppe at daimlerchrysler-bank dot com
Hi,

I'll send you a nice testsript tomorrow (European Time).

cu
 [2002-05-01 12:50 UTC] thomas dot hoppe at daimlerchrysler-bank dot com
I'm happy to report, that I've minimized the problem to one lil script in order to demonstrate it easily.

I sent a description and the script to thies@php.net.
If someone else needs it - drop a message!
 [2002-05-01 12:59 UTC] thomas dot hoppe at daimlerchrysler-bank dot com
x
 [2002-05-01 13:01 UTC] thomas dot hoppe at daimlerchrysler-bank dot com
Ahhhhrggh, There was an error in my testscript. Gotta search on :(
 [2002-05-01 13:36 UTC] thomas dot hoppe at daimlerchrysler-bank dot com
This is not my day. I figured out that the bug is not in php but in my code.

So sorry for the time I've wasted and please close the ticket.
 [2002-05-01 14:09 UTC] derick@php.net
Closing per user request.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 20:01:29 2024 UTC