[CDBI] Re: odd swapping database issue on vhost / mason install

Rolf Schaufelberger rs at plusw.de
Tue Apr 3 08:24:06 BST 2007


> Instead of fighting to keep the CMS::DBI modules separate, you could
> instead merge them and make them identical. In other words, have one
> CMS::DBI module that returns the appropriate dbh for each vhost by
> overriding db_Main(). Take a look at
> http://wiki.class-dbi.com/wiki/Using_with_mod_perl
> You *definitely* need to disable the object index in this scenario,
> otherwise the index could become cross-contaminated.
I'm using this setup since years and have many vhosts running in one 
apache/mod_perl setup and with identical CDBI-Source without problems (and 
withut disabling the object index!).
I'm using postgres and with postgres I use schemas , so I have some schemas 
common to all vhosts and one schema for each vhost, each of this with the 
same tables but different data. The search_path is set in db_Main, no 
problems with that at all. Maybe this is a solution for you too and you don't 
need the set_up_tables(client[1..n]) .

Rolf Schaufelberger
rs at plusw.de

More information about the ClassDBI mailing list