[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [cgiapp] CAP::DBH + FastCGI: persistent DB connections, please


From: Josh Danziger <suppressed>
>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/suppressed/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.