As far as I know, this is not supported behaviour within DBI or any existing module which supports DBI - Nevertheless, it would not be particularly difficult to create such a module which when called would create its only individual DBI handles to the respective database servers and when passed a execution request, forwarded it onto each DBI handle.
Update - Have a look at DBD::Multiplex as pointed out by lhoward in the post below
Ooohhh, Rob no beer function well without! | [reply] |
If it's just for redundancy (and load balancing), you could make a wrapper for the DBI module that upon a database failure will try to replay to transaction on the other server. If it's only for reading it shouldn't be too hard.
 - ask
--
ask bjoern hansen, http://ask.netcetera.dk/ !try; do();
| [reply] |
| [reply] [d/l] [select] |
--
ask bjoern hansen, http://ask.netcetera.dk/ !try; do();
| [reply] |
This is one of the things that DBD::Multiplex is written for.
I've been interested in trying out DBI::Multiplex for
a while, but its lack of documentation or examples had made it a
frustrating and fruitless exploit. About the only halfway decent
thing I've found on it is here.
The package itself also doesn't seem to have changed since
July of 1999 (it comes bundled with DBI).
| [reply] |
Mostly ontopic: SPOPS could be fairly easily modified to give you this sort of functionality. I already created a very similar module for the LDAP interface (SPOPS::LDAP::MultiDatasource) and doing it for DBI would be relatively simple. As lhoward brought up, one of the issues is what to do if the second (or third, or...) INSERT/UPDATE/DELETE fails. But we've already got a crude-but-improving framework for that.
Now that I think about it, I'm going to put this on the feature request list. Being able to publish or select information from different databases (even databases from different vendors, on different hosts) would be pretty cool.
Chris
M-x auto-bs-mode
| [reply] |