perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel <embp...@7thfire.com>
Subject Re: Re: object life
Date Tue, 28 Feb 2006 05:53:05 GMT
On Mon, Feb 27, 2006 at 05:24:55PM +0100, RobertCZ wrote:
> not very clear what exactly you are doing - you have two apache virtual 
> servers both using Embperl::Object and they clash? you use 
> Embperl_App_Name, right?

hm, no, not quite.
> 
> if I dont understand, would you mind showing us some simplified code?

let me try.

index.epl has a use statement.
use db;

That loads a Class::DBI database abstraction class.

I have two instances of my application running.

they live in two different paths, but the db module exists in both.

the db module get's loaded with certain configs, which live in
config.pm which is done with a require.

my $cfg = require config.pm or some such.

I have a function for the database abstraction class called getConfig.

For my two instances, if I do something like this...

print OUT $db_inst->getConfig->{'mysql'}{'dbname'}

from indexer.epl, and I keep reloading, sometimes I will get the dbname
appropriate for the first instance of my application, and sometimes for
the second.

My applications both share the same framework, but are supposed to run
as completely seperate instances.

I think apache objects witht he same filenames get passed around,
regadless if the content is different.

Let me give an example of another scenario where I've seen it happen.

I've got one version of db.pm loaded for one app, then I have another
db.pm loaded for another app. Apache shares the loaded libraries between
it's instances, and one version of db.pm may have a function called
PrintRows, while the other doesn't. Randomly the correct one will get
loaded, randomly not.

has noone bumped into this? I think apache for speeds sake is trying to
load the classes and keep them in memory.

Is there no way to turn that 'off' ?

I hope this is more clear.

-d




---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Mime
View raw message