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

Re: DBI error and $@

by Arguile (Hermit)
on Dec 06, 2001 at 21:32 UTC ( #130006=note: print w/replies, xml ) Need Help??


in reply to DBI error and $@

Personally when I'm doing transaction handling I use Error or other exception handling modules. The addition of a little syntatic sugar make a lot of difference. You can also define your own error classes for more complex failovers.
use Error qw(:try); # ... code passes ... try { # Execute a few queries $sth->execute( $str ); # If we're here everything is fine, let's commit. $dbh->commit; } catch Error with { my $err = shift; print "Transaction Failed: $err"; $dbh->rollback; };

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://130006]
help
Chatterbox?
[Lady_Aleena]: I don't know what to tell you. I can barely get my Linux machine to do things I want.
[Discipulus]: if DE or WM means desktop env and win manager.. no, not an option
[Lady_Aleena]: That's what they mean, at least to me. 8)
[Discipulus]: in the first attempt i failed, with an not usable v-machine.. ;=)
[Discipulus]: but then discovered a registry trick to do before the physical2virtual migration
[Lady_Aleena]: Sounds like a headache.
[Discipulus]: a bit shaggy.. every atttempt is ~4hours to virtualize and 1-2hours to kick the big file to boot..
[Lady_Aleena]: Ouch...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2017-05-22 18:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?