php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35322 oci_connect() after oci_close() gives unknown resource
Submitted: 2005-11-22 08:03 UTC Modified: 2005-11-24 16:15 UTC
Votes:1
Avg. Score:1.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: cjbj at hotmail dot com Assigned: tony2001 (profile)
Status: Closed Package: OCI8 related
PHP Version: 5CVS-2005-11-23 (snap) OS: *
Private report: No CVE-ID: None
 [2005-11-22 08:03 UTC] cjbj at hotmail dot com
Description:
------------
The call sequence
  oci_connect
  oci_close
  oci_connect
returns an unknown resource.

Reproduced on Linux with Zend Core for Oracle (PHP 5.0.5)

Reproduced on Windows with PHP 5.0.6-dev Nov 3 2005 18:23:25 using OCI8 1.1 php_oci.dll downloaded from http://pecl4win.php.net/ext.php/php_oci8.dll on Nov 4.

The problem is possibly related to http://bugs.php.net/bug.php?id=35205

Reproduce code:
---------------
<?php

$user = "hr";
$pass = "hr";
$databaseName = "//localhost/XE";

echo "<pre>"; var_dump($user, $pass, $databaseName); echo "</pre>";

$conn = oci_connect( $user, $pass, $databaseName);

echo "<pre>"; var_dump($conn); echo "</pre>";

if (!$conn) {
  echo "connection 1 failed";
  exit;
}

oci_close($conn);

$conn = oci_connect( $user, $pass, $databaseName);

echo "<pre>"; var_dump($conn); echo "</pre>";

if (!$conn) {
  echo "connection 2 failed";
  exit;
}

oci_close($conn);

?>

Expected result:
----------------
    string(2) "hr"
    string(2) "hr"
    string(14) "//localhost/XE"
    resource(2) of type (oci8 connection)
    resource(2) of type (oci8 connection)

Actual result:
--------------
    string(2) "hr"
    string(2) "hr"
    string(14) "//localhost/XE"
    resource(2) of type (oci8 connection)
    resource(2) of type (Unknown)
    Warning: oci_close(): 2 is not a valid oci8 connection resource in /home/cj/public_html/php/t1.php on line 29


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-11-22 11:52 UTC] tony2001@php.net
Work fine here, with latest OCI8 from CVS.
 [2005-11-22 13:22 UTC] cjbj at hotmail dot com
Reproduced on Windows with 5.1.0RC7-dev (Nov 22 2005 08:23:50) with matching OCI8 1.1 DLL. I'll check Linux tomorrow and see if I can get some debug info.
 [2005-11-22 13:24 UTC] tony2001@php.net
Thanks.
That would be very much appreciated.
 [2005-11-23 07:16 UTC] cjbj at hotmail dot com
I have emailed Antony a little trace info.
 [2005-11-24 16:15 UTC] tony2001@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed Jul 06 23:04:05 2022 UTC