No such thing as a small change | |
PerlMonks |
DBI and finishby wind (Priest) |
on Jun 26, 2014 at 07:53 UTC ( [id://1091303]=perlquestion: print w/replies, xml ) | Need Help?? |
wind has asked for the wisdom of the Perl Monks concerning the following question: Is it really THAT bad to call $sth->finish in legacy code? As per the documentation for DBI->finish: $rc = $sth->finish; Now, I get how it's not needed, but the warnings in this documentation appear a bit hyperbolic. Are these warnings exaggerated? Or is legacy code that still includes finish calls as an idiomatic way to communicate intent actually a “mistake” instead of merely wasted effort? This only came up because of a comment on stackoverflow where I helped someone simplify their code by suggesting they loop instead of manually calling prepare, execute, finish for every SQL statement. I therefore researched for more info on this, but was only able to find the following resources:
Anyway, I aim to use DBIx::Class and other constructs instead of manual calls to DBI, so this rarely comes up for me. However, I would like to understand the actual risk of needlessly calling finish, or if this is just an effort to get people to streamline their code?
Back to
Seekers of Perl Wisdom
|
|