DBI / DBD-Oracle problem, database disconnected 
Author Message
 DBI / DBD-Oracle problem, database disconnected

I am having an intermitten problem.  I have a perl script that generates
web pages pulling data from an Oracle database.  I am using:
 Perl: 5.00503
 DBI: 1.13
 DBD-Oracle: 1.03

 I get this entry in the error_log:
 DBD::Oracle::db prepare failed: ERROR Database disconnected at
/path/to/file/openwork.pl line 313.
 [Tue Aug 15 0:57:49 2000] [error] Can't prepare SQL statement: ERROR
Database disconnected

 Now if I reload the web page, _Most_ of the time, it will then run.  On
the occasions that it does not reload properly, if I give Apache a -HUP,
it always works.

 At the beginning of the script I have:
 $db=DBI->connect("dbi:Oracle:host=machine;sid=orcl","acct","password")
   || die "Connect Failed: $DBI::errstr";

 I then call subroutines, and included in them are:
 $sql = "SELECT stuff FROM table WHERE condition";
 $cur = $db->prepare("$sql")
   || die "Can't prepare SQL statement: ", $db->errstr(), "\n";
 $cur->execute()
   || die "Can't execute SQL statement: ", $cur->errstr(), "\n";
 while (($stuff) = $cur->fetchrow_array) {
   do some things here...
 }
 warn "Problem in fetchrow_array(): ", $cur->errstr(), "\n"   if
$cur->err();

 I often call multiple subroutines, some with database connections. At
the end of the script I have:
 $db->disconnect()
   || warn "Failed to disconnect: ", $db->errstr(), "\n";

 Looking through this, I notice I don't have any finish().  Could that
be part of it?  Anyhow.  Is there a way to capture the disconnection and
force a reconnect?  Any ideas are welcome.

 Erik



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. oracle database login with perl DBD/DBI and kerberos authentication

2. Oracle DBD/DBI on HP-UX: can't load Oracle.sl

3. Installing DBD - Oracle - 0.6 Problems (DBI)

4. Bizarre DBI/DBD::Oracle Problem(?)

5. Problems reading/writing LOB in DBI / DBD-Oracle

6. Problem with DBI / DBD (Oracle)

7. bind variable problem in DBI, DBD::Oracle

8. multiple connection problems with DBI DBD::Oracle

9. DBI/DBD Oracle/Apache problem

10. ORACLE database access problem (DBI)

11. ORACLE database access problem (DBI)

12. Problems backing up Oracle control files via DBD::Oracle

 

 
Powered by phpBB® Forum Software