That's funny, I just read about this today... See Tim Bunce's
tutorial from the Perl 3.0 Conference. I think it will answer some of
your questions...
Actually I couldn't find it from 99 but here is one from 2004.
http://search.cpan.org/src/TIMB/DBI_AdvancedTalk_2004/index.htm
Shawn
--------------------
Shawn Michael Hinchy
[EMAIL PROTECTED]
Quoting Tyler Gee <[EMAIL PROTECTED]>:
On 11/14/06, Steve Green <[EMAIL PROTECTED]> wrote:
Robert Hicks wrote:
How is it best to catch errors when doing DBI stuff in web applications?
Wrap the insert "code" in an eval statement? Croak or die statements? I
am thinking eval because I can set autocommit to "off" and then do
rollbacks if $@ has an error.
You should probably avoid eval just because it spawns a separate perl
process each time, so if this is some code that is getting hit a lot,
you could really tax your server.
The PrintError, RaiseError, and HandleError attributes of a DBI handle
provide useful ways of dealing with errors that the database returns.
This is the standard way of detecting errors with DBI.
-- SG
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
--
~Tyler
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>