ASP setup using common set of C::DBI modules

[prev] [thread] [next] [Date index for 2004/07/28]

From: jason scott gessner
Subject: ASP setup using common set of C::DBI modules
Date: 19:43 on 28 Jul 2004
Hi All.

This is my setup and i want to make it more elegant.  If anyone is 
doing something similar, but prettier, please let me know what i am 
missing.

I have a set of classes all under a single namespace for my app.  These 
modules are used by several mod_perl/mason applications living on 
multiple VHOSTS on the same physical server (for now).  I have some 
wrapper functions in my C::DBI wrapper class that let me choose from a 
list of database instances on multiple servers.  That is super handy 
and works fine.  However, what happens is that mod_perl caches that 
class once for all the vhosts.  So if i set an instance in one host, it 
clobbers the other hosts.

My solution right now has been to call my _setInstance() function using 
an environment variable in the appropriate places in my mason scripts.  
Since they all inherit from my autohandlers, the individual apps are 
A-OK with this, but it seems wasteful and inefficient.

I have another app that i want to run like this, with different skins 
and database connections, but otherwise the same set of classes for the 
application itself.

So, my questions are,
1)	can i force a certain module to cache differently for each vhost?
2)	is there a certain method i can override in C::DBI and maybe 
dynamically generate my DBI base class in each app's startup.pl?
3)	is anyone else encountering this same issue?

Thanks!


-jason scott gessner
     jason@xxxxxxxx.xxx

ASP setup using common set of C::DBI modules
jason scott gessner 19:43 on 28 Jul 2004

Re: ASP setup using common set of C::DBI modules
Michael Graham 20:33 on 28 Jul 2004

Re: ASP setup using common set of C::DBI modules
Michael Graham 22:01 on 28 Jul 2004

Re: ASP setup using common set of C::DBI modules
jason scott gessner 20:24 on 29 Jul 2004

Generated at 11:34 on 01 Dec 2004 by mariachi v0.52