DBD::Oracle: finish doesn't free resources 
Author Message
 DBD::Oracle: finish doesn't free resources

 I'm using perl 5.004_04 with DBI 0.93, DBD:Oracle 0.48,
and Oracle 7.3 on Solaris 2.5.

  It seems that that the finish method doesn't actually
free any resources. Specifically, if I repeatedly prepare,
execute, and finish a statement handle, I get an
"ORA-01000: maximum open cursors exceeded (DBD: oopen error)"
error.

  Here is a sample script which demonstrates the error.
It should crash if you have more tables in your schema than
available Oracle cursors. (At least, it crashes on my
system.)

------------------------------------
#!/usr/bin/perl

# $dbh = connect to your Oracle database ..

# Grab all the table names in this schema.
# My database has over 50 tables.

$sth_tables = $dbh -> prepare (qq{
   select table_name
     from user_tables
 order by table_name

Quote:
});

$sth_tables -> execute;      

$n = 0;
while (($table) = $sth_tables->fetchrow_array) {
    $n++;
    print "Preparing $table ($n)\n";

    $sth = $dbh -> prepare ("select * from $table")
        || die $DBI::errstr;

    $sth -> execute;
    $sth -> finish;

Quote:
}

$sth_tables -> finish;  
------------------------------------

  I can work around the problem by frequently
disconnecting and reconnecting to the database,
but that's a {*filter*} solution.

  I've also noticed that I can prepare a statement,
execute it, finish it, and then execute it again.
My understanding is that once I finish a statement,
I have to prepare it again.

  Any clues?

Todd Hivnor
<hivnor at shore dot net>



Wed, 22 Nov 2000 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. perl cgi script doesn't finish after calling system command

2. Script doesn't always finish

3. CGI::Push doesn't Finish

4. PROBLEM: cgi doesn't wait for perl process to finish - times out

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

6. DBD:Oracle: Bad free() ignored during global destruction

7. Where is '_dl_unload_cache' (DBD-Oracle)

8. DBD::Oracle hangs on 'make test'

9. DBD Oracle 'make test' fails

10. DBD:CSV /script doesn't INSERT data when supllied via html form

11. Error running ActiveWare's version of DBD:Oracle

12. can't retrieve data from Oracle DB using DBI and DBD

 

 
Powered by phpBB® Forum Software