Re: object caching and mod_perl

[prev] [thread] [next] [Date index for 2004/06/08]

From: Perrin Harkins
Subject: Re: object caching and mod_perl
Date: 14:02 on 08 Jun 2004
jason scott gessner wrote:
> 1)    where is this type of caching useful?  I took a brief look at the 
> code and it seems that it does some sort of checking, but how does it 
> know when to kill an object?

As explained in the docs, the purpose of this cache is to avoid 
accidentally creating multiple copies of an object in memory at once and 
overwriting changes.  It also avoids going to the database for objects 
that are already in memory.

Scoping of objects is not changed by this caching.  It uses weak 
references.  If your objects are staying around with the cache, then 
they were before too but you didn't notice it.

> 2)    Should this new behaviour even be the default?  This took a 
> working application and made it all wonky.  Did any other people 
> encounter this?

You have scoping problems of some kind in your code.  Either you are 
putting things in globals, or accidentally creating closures.

> 3)    is there a better way to have this behave with mod_perl applications?

If you are not able to fix your scoping problems, you can add a 
cleanup_handler to mod_perl that will clear the cache.  If there is 
demand for it, we could also add a method to turn the cache off completely.

- Perrin

(message missing)

TEMP columns not populated by sth_to_objects in 0.96
David Jack Olrik 08:54 on 08 Jun 2004

object caching and mod_perl
jason scott gessner 13:28 on 08 Jun 2004

Re: object caching and mod_perl
Tony Bowden 13:46 on 08 Jun 2004

Re: object caching and mod_perl
Perrin Harkins 14:02 on 08 Jun 2004

Re: object caching and mod_perl
jason scott gessner 14:11 on 08 Jun 2004

Re: object caching and mod_perl
Edward J. Sabol 14:52 on 08 Jun 2004

Re: object caching and mod_perl
jason scott gessner 16:31 on 11 Jun 2004

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