Bug #3552: Ora_Error causes fake "not connected to Oracle" error to remote database
| From: | joop dot vriend at ddnh dot nl | Date: | Mon, 21 Feb 2000 19:24:44 +0000 |
| Subject: | Bug #3552: Ora_Error causes fake "not connected to Oracle" error to remote database | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-15787@lists.php.net to get a copy of this message | ||
From: joop.vriend@ddnh.nl
Operating system: Linux 2.2.10 SMP
PHP version: 3.0.12
PHP Bug Type: Oracle related
Bug description: Ora_Error causes fake "not connected to Oracle" error to remote database
We use the following function (in a "library" file we include with PHP at the top of a
page) to parse and execute a query on an Oracle-database:
function ParseExec($conn, $curs, $query) {
if (! $conn)
ErrorClose("<BR><BR><B>ERROR:</B> GEEN VERBINDING!!!");
if (ora_Parse($curs, $query, 0) == -1)
ErrorClose("<BR><BR><B>ERROR:</B> SQL parse error");
// Bewaar de evt. parse error
$orcl_error = ora_Error($curs);
if (! ora_Exec($curs)) {
if (strstr($orcl_error, "ORA-00000")) $orcl_error = ora_Error($curs);
$fout = "<BR><BR><B>ERROR:</B> Execute error\n\n";
$fout .= "<BR><BR><B>QUERY:</B> " . $query . "\n\n";
$fout .= "<BR><BR><B>ORACLE ERROR:</B> " . $orcl_error .
"\n\n";
if ($conn && ! ora_RollBack($conn))
$fout .= "<BR><BR><B>ERROR:</B> Could not rollback\n\n";
ErrorClose($fout);
}
}
If we use this function with a database on the same machine (Ora_Logon without TNSNAME), there is no
problem. If we are connected to a remote database (Ora_Logon with a TNSNAME) the Ora_Error statement
-- $orcl_error = ora_Error($curs); -- causes the Ora_Exec statement to give the following error
message (mind the OPARSE !):
ORA-03114: not connected to ORACLE -- while processing OCI function OPARSE
If we comment out the Ora_Error statement, the problem does not occur.
I have not checked whether this problem also exists with PHP 3.0.14. If it does not, sorry for the
inconvenience and I would appreciate it very much if you would tell me.
This is our configure line:
./configure --with-apache=/usr/src/apache --with-gd=/usr/src/gd
--with-oracle=/u01/app/oracle/product/8.0.5 --with-pgsql --with-dbase=yes
--with-config-file-path=/usr/local/apache/conf --enable-debug=no --enable-track-vars=yes
--enable-magic-quotes=yes
Joop Vriend
DD&H Internet Vision
Enschede, The Netherlands
Keep up the good work!