ID:               29013
 Updated by:       [EMAIL PROTECTED]
 Reported By:      cjbj at hotmail dot com
-Status:           Open
+Status:           Analyzed
 Bug Type:         OCI8 related
 Operating System: Windows, Linux
 PHP Version:      4.3.7, 5.0.0 Dev
 Assigned To:      tony2001
 New Comment:

I can see the problem now. 
Will look at it closer a bit later..


Previous Comments:
------------------------------------------------------------------------

[2004-10-14 10:11:36] cjbj at hotmail dot com

Using one user would make it harder to demonstrate the 
problem. Sorry I didn't include create user scripts etc.

I retested with 4.3.10-dev and 5.0.3-dev binaries of a few 
minutes ago. I am using W2K with Oracle 9.2 client libraries.
I am still seeing the usernames printed as SCOTT and HR, 
which is "incorrect".

------------------------------------------------------------------------

[2004-10-12 07:20:03] [EMAIL PROTECTED]

No, of course you should able to connect to Oracle from PHP using
different logins. 
My question should be read in this way: "are you able to reproduce it
under 1 user, but with different connections, because I was too lazy to
create a new user in Oracle?".
Btw, I've already created additional user and tested your code - your
example works perfectly for me.

------------------------------------------------------------------------

[2004-10-12 05:38:56] cjbj at hotmail dot com

The "business requirement" comes from the original report in
http://forums.oracle.com/forums/thread.jsp?forum=178&thread=251141

I don't think the way $c1 is impacted by the second login is obvious
or nice behavior.

I feel the problem is related to some of the common OCI8 connection
issues due to the caching and reuse of handles.  It would be nice to
resolve these issues.

There is no Oracle-OCI reason why two users can't be connected at one
time.  I think it should be allowed in PHP.  But if you think the
PHP-OCI8 interface should not support concurrent connections, can a
PHP error be generated at the time of the second OCINLogin()?

------------------------------------------------------------------------

[2004-10-10 17:02:43] [EMAIL PROTECTED]

Chris, is it important to have different users in your example?
Tested under 1 user (but using ociNlogin();) and it works fine.

------------------------------------------------------------------------

[2004-08-13 05:32:39] cjbj at hotmail dot com

The given testcase has an extra semi-colon in the second query.  The
new testcase below shows that the initial connection is getting
associated with the second user.

Testcase:

<?php
  function qry(&$c, $s) {
      echo "===&gt;BEGIN<br>";
      $rSth = OCIParse($c, $s);
      $rRet = OCIExecute($rSth);
      echo "<br>";
      while ($succ = OCIFetchInto($rSth, $row)) {
        foreach ($row as $item) {
          echo ($item?htmlentities($item):'&nbsp;')." ";
        }
        echo "<br>\n";
      }
      echo "===&gt;CLOSE<br><br>";
      ocifreestatement($rSth);
  }

  $statement1 = "select user from dual";

  echo "===&gt;OCINLogin #1: Connect as SCOTT<br>";
  $c1 = OCINlogon('scott', 'tiger', 'F10D' );

  echo "===&gt;Query first connection<br>";
  qry($c1, $statement1);

  echo "===&gt;OCINLogin #2: Connect as HR<br>";
  $c2 = OCINlogon('hr', 'hr', 'F10D');

  echo "===&gt;Re-query first connection<br>";
  qry($c1, $statement1);

?>

Actual Output:

===>OCINLogin #1: Connect as SCOTT
===>Query first connection
===>BEGIN

SCOTT
===>CLOSE

===>OCINLogin #2: Connect as HR
===>Re-query first connection
===>BEGIN

HR
===>CLOSE


Expected output is similar with the usernames in this order: SCOTT,
SCOTT

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/29013

-- 
Edit this bug report at http://bugs.php.net/?id=29013&edit=1

Reply via email to