Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: DBI perpare_cached and statment handle gone bad

by lhoward (Vicar)
on Jul 08, 2003 at 20:21 UTC ( #272442=note: print w/ replies, xml ) Need Help??


in reply to DBI perpare_cached and statment handle gone bad

Here's a little test program I use to replicate the issue:

#!/usr/bin/perl -w use strict; use DBI; my $dbh=DBI->connect('zzz','zzz','zzz'); while(1){ my $sth=$dbh->prepare_cached('select count(*) from EXAMPLE'); $sth->execute(); my @r=$sth->fetchrow(); print "$r[0]\n"; $sth->finish(); sleep 10; } $dbh->disconnect();
When I do the work to EXAMPLE that invalidates the statment handle, my example code returns the following:
DBD::Oracle::st execute failed: ORA-00942: table or view does not exist (DBD ERROR: OCIStmtExecute)

DBD::Oracle::st execute failed: ORA-01003: no statement parsed (DBD ERROR: OCIStmtExecute)
What I'd like is for prepare_cached to recover gracefully from these types of intermittent hiccups. Any ideas?

L


Comment on Re: DBI perpare_cached and statment handle gone bad
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://272442]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (11)
As of 2015-07-06 21:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (83 votes), past polls