Re: Singleton Persistence

Chris Bennett <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <[email protected]>
On Mon, Feb 03, 2014 at 04:44:01PM -0500, John Dunlap wrote:
> My current workaround is using this option in my apache configuration,
> PerlOptions +Parent
> 
> to make sure that interpreters aren't shared between virtualhosts. However,
> this isn't good from a resource sharing perspective so it sounds like I may
> need to re-architect some of my code.
> 

Maybe this is the right thread for this question.
I am sharing my .pm modules with several VirtualHosts.
Using Apache 1.3* and mod_perl 1.

Right now I am using pg_1_.pl and pg_2.pl on the different hosts, but
the code is identical, except that some data is pulled in from a config
file for the different databases, etc used.

Can I safely use pg.pl on both VirtualHosts or do I need to do something
else also to do this?
Thanks,
Chris Bennett

> 
> On Mon, Feb 3, 2014 at 4:30 PM, Vincent Veyron <[email protected]> wrote:
> 
> > Le samedi 01 février 2014 à 20:14 -0500, John Dunlap a écrit :
> > > In mod_perl, can instantiated singletons survive requests? I'm asking
> > > because I appear to have one which *appears* to be bouncing back and
> > > forth between virtual hosts as perl interpreters are recycled. Is this
> > > possible and, if yes, how do I prevent it?
> > >
> >
> > Showing some code exhibiting the behaviour would help. You probably hit
> > something similar to this :
> >
> > http://perl.apache.org/docs/1.0/guide/porting.html#An_Easy_Break_in
> >
> > In any case, a singleton resides in the perl interpreter, which is used
> > by apache's child process to serve many requests, so it will survive
> > requests.
> >
> > You can do this however (I don't remember the exact parameter just now,
> > it's in the doc or the archives) :
> >
> > http://perl.apache.org/docs/2.0/user/design/design.html#Virtual_Hosts
> >
> > --
> > http://libremen.com
> > Gestión de litigios y de expedientes de seguros de siniestros para el
> > servicio jurídico
> >
> >
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.