[CDBI] Best way to select dataserver at runtime?

James M jmessrie at cox.net
Fri Mar 3 06:31:06 GMT 2006

I'm sure this was answered before but what is the best way using CDBI to be
able to point to a different server at runtime.  Essentially, I want to set
it up so that based on the class method I call, it will point to a
read/write or read-only database server.  For example:

Music::CD->insert({...}); # Automatically point to read/write datasource.
Music::CD->retrieve(...); # Point to read-only.
Music::CD->retrieve_for_update(...); # Point to read/write.

Would I just call the connection method inside my base class's methods?
Also, would this have any performance impact and how would it affect things
if running with Apache::DBI.



More information about the ClassDBI mailing list