From: Josh Danziger <[EMAIL PROTECTED]> >You misunderstood my original statement. I was suggesting that the $dbh->ping() call be put in the cgiapp_init() block or an equivalent, and run once per execution of the PAGE, not before very DBI call!
The same principle isn't it? Why test for a successful condition prior to accessing the DB, when you would expect most accesses to be successful? A slightly more robust error-handling routine (to accomodate retries) not only eliminates pre-access tests but also seamlessly handles what may be intermittent failures (network problems, timeouts?). >The whole discussion was made irrelevant once we start using the connect_cached() method. Does connect_cached do the ping for you? I noticed you described it as using the cached handle if the database is still available. It sounded like it simply performs the pre-access work for you (which to me, I don't like). >What you're describing sounds like the perfect use of the hacked up try/catch >blocks in CPAN. Do you have a name of something I could look at? I'm not familiar with it. Thanks, Mark --------------------------------------------------------------------- Web Archive: http://www.mail-archive.com/[email protected]/ http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2 To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
