in reply to How to safely test if a database handle is capable of transactions?
Hi,
While it's not breaking encapsulation, as Limbic~Region corrected, using 'begin_work' is the recommended way, as you get blamed by the driver if it's not supported
eval { $dbh->begin_work; # ... $dbh->commit; }; if ($@) { $dbh->rollback; # If you want to be paranoid, check if it rolled back. # Look at manual: man DBI }
Hope this helps you a bit
Regards,
Update: corrected about the encapsulation, thanks Limbic~Region
fmerges at irc.freenode.net
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: How to safely test if a database handle is capable of transactions?
by Limbic~Region (Chancellor) on Nov 18, 2008 at 23:24 UTC | |
Re^2: How to safely test if a database handle is capable of transactions?
by ikegami (Patriarch) on Nov 19, 2008 at 17:13 UTC |
In Section
Seekers of Perl Wisdom