Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Class::DBI::AbstractSearch and SpeedyCGI

by shemp (Deacon)
on Oct 04, 2005 at 04:06 UTC ( [id://497126]=note: print w/replies, xml ) Need Help??


in reply to Class::DBI::AbstractSearch and SpeedyCGI

If you're not doing it already, trap errors with ALL queries. Set the RaiseError flag on your db handle, and then make all executes look like this, or with some other useful error handling:
... my $query_handle = $db_handle->prepare($query); eval { $query_handle->execute(); }; if ( $@ ) { confess "Query Error $DBI::errstr\nQuery: $query\n"; }
And if you are using Bind Params, dump them too.
I use the most powerful debugger available: print!

Replies are listed 'Best First'.
Re^2: Class::DBI::AbstractSearch and SpeedyCGI
by zigdon (Deacon) on Oct 04, 2005 at 10:51 UTC
    I would, and did, when I execute my own queries... But with CDBI, it's all done so many layers lower than my code, that I'm not even sure where the eventual execute happens! I do believe RaiseError is set though, since the code does die when the error occures.

    -- zigdon

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (7)
As of 2024-04-23 20:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found