Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re^2: dbh->disconnect or leave to scope

by Cagao (Monk)
on Jan 19, 2011 at 10:16 UTC ( #883079=note: print w/replies, xml ) Need Help??

in reply to Re: dbh->disconnect or leave to scope
in thread dbh->disconnect or leave to scope

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).

  • Comment on Re^2: dbh->disconnect or leave to scope

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://883079]
[Corion]: We-ird - I hadn't known this, but Ingress and Pokemon Go (both AR games in the real world where you run around) switched from using Google Maps to OpenStreetMaps, which is great. But I wonder why, as Ingress is (was?) owned by Google/Alphabet. But ...
[Corion]: ... maybe not wholly owned, or the load on Google Maps was too high?!

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2018-03-19 09:06 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (236 votes). Check out past polls.