The stupid question is the question not asked | |
PerlMonks |
Re^2: dbh->disconnect or leave to scopeby Cagao (Monk) |
on Jan 19, 2011 at 10:16 UTC ( [id://883079]=note: print w/replies, xml ) | Need Help?? |
We connect to 3 DB platforms (all on MySQL tho). One is a single master, the other 2 are masters with several slaves. I don't pass dbh's around between methods, since sometimes I may have connected to a slave for read-only operations, but might have passed the the dbh into a method requiring write access to the master, so it's easier to connect in each method (to the relevant master/slave), plus, it's MySQL, so not a massive hit on the connection time. We clearly connect/disconnect a fair amount, but this isn't causing performance implications (yet).
In Section
Seekers of Perl Wisdom
|
|