in reply to How to share DBI connections between objects?
I'm pretty sure that DBI does pool connections, but i can't prove it.
Update both adrianh in Re^2: How to share DBI connections between objects? and
perrin in Re^2: How to share DBI connections between objects? suggest I made this up.
In your example, I'd have a My->Db method, that returned an already connected $dbh this way all the My:: classes and modules can get a database handle when they want it, and you only have to manage the connecting in once place. Some folks call this a factory
this also means that you can change how the connection is made etc in one place.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to share DBI connections between objects?
by adrianh (Chancellor) on Mar 26, 2007 at 14:34 UTC | |
by f00li5h (Chaplain) on Mar 27, 2007 at 03:21 UTC | |
by adrianh (Chancellor) on Mar 27, 2007 at 12:38 UTC | |
by f00li5h (Chaplain) on Mar 28, 2007 at 00:21 UTC | |
|
Re^2: How to share DBI connections between objects?
by perrin (Chancellor) on Mar 26, 2007 at 15:19 UTC |