Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: Global dbh and insertsby sundialsvc4 (Abbot) |
on Feb 19, 2014 at 14:13 UTC ( [id://1075461]=note: print w/replies, xml ) | Need Help?? |
I would recommend that things like last_insert_id be used only immediately after a statement that inserted something, and that the pair of statements be wrapped in an SQL transaction with an appropriate isolation level. This kind of highly-temporal value must not be maintained in any sort of global variable. If you do that, you will create a “random, un-reproducible, yet very fatal” bug of the very, very worst kind.
In Section
Seekers of Perl Wisdom
|
|