You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jcs-users@jakarta.apache.org by cj22 <ch...@gmail.com> on 2008/12/10 03:25:35 UTC

Item lifespan based on last access?

Hello,

I was wondering if there was a way to keep an item in the cache alive based
on its access time.  Currently the MaxLifeSeconds is based upon the creation
of the key, regardless of how many accesses it has.  I would like to keep an
object in the cache until it stops being used.

Is there anyway to configure JCS to do this?  

A possible workaround would be to re-put the key on every access but I would
rather avoid doing all the extra coding to make the change.

Also I could not find a configuration to flush the disk cache on server
start (or stop).  The help pages seemed to hint at it, but I could not find
the params for it.

Any help is greatly appreciated!

Thanks,
Chris
-- 
View this message in context: http://www.nabble.com/Item-lifespan-based-on-last-access--tp20928001p20928001.html
Sent from the JCS - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jcs-users-help@jakarta.apache.org


Re: Item lifespan based on last access?

Posted by cj22 <ch...@gmail.com>.
Awww crap...

I am confusing the MaxMemoryIdleTimeSeconds cache attribute...

My bad, I will try this out.

Thanks!


cj22 wrote:
> 
> Thanks for the response,
> 
> I am familiar with how the idleTime works, and that is not what I am
> looking for.  Regardless of whether or not an item is continuously
> accessed, it still will get purged from the cache when MaxLifeSeconds
> expires.  I am looking for a way for the item to remain in cache *UNTIL*
> it "idles" out, regardless of MaxLifeSeconds.
> 
> Setting the cache to eternal is not desired either...
> 
> For example to clarify:
> 
> MaxLifeSeconds=100
> IdleTime=50
> 
> -An item is created, after 50 seconds it goes to disk.
> -After 80 seconds a get is called for the item
> -Item gets moved back into memory
> -After 100 seconds item expires....
> 
> In this scenario I would like the item to live for 180 seconds.  The
> lifespan should continue to increase based upon access time too.
> 
> Thanks again,
> Chris
> 
> 
> Thomas Vandahl-2 wrote:
>> 
>> cj22 wrote:
>>> I was wondering if there was a way to keep an item in the cache alive
>>> based
>>> on its access time.  Currently the MaxLifeSeconds is based upon the
>>> creation
>>> of the key, regardless of how many accesses it has.  I would like to
>>> keep an
>>> object in the cache until it stops being used.
>>> 
>>> Is there anyway to configure JCS to do this?  
>> 
>> The element attribute setting is called IdleTime.
>> 
>> Bye, Thomas
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: jcs-users-help@jakarta.apache.org
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Item-lifespan-based-on-last-access--tp20928001p20942517.html
Sent from the JCS - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jcs-users-help@jakarta.apache.org


Re: Item lifespan based on last access?

Posted by cj22 <ch...@gmail.com>.
Thanks for the response,

I am familiar with how the idleTime works, and that is not what I am looking
for.  Regardless of whether or not an item is continuously accessed, it
still will get purged from the cache when MaxLifeSeconds expires.  I am
looking for a way for the item to remain in cache *UNTIL* it "idles" out,
regardless of MaxLifeSeconds.

Setting the cache to eternal is not desired either...

For example to clarify:

MaxLifeSeconds=100
IdleTime=50

-An item is created, after 50 seconds it goes to disk.
-After 80 seconds a get is called for the item
-Item gets moved back into memory
-After 100 seconds item expires....

In this scenario I would like the item to live for 180 seconds.  The
lifespan should continue to increase based upon access time too.

Thanks again,
Chris


Thomas Vandahl-2 wrote:
> 
> cj22 wrote:
>> I was wondering if there was a way to keep an item in the cache alive
>> based
>> on its access time.  Currently the MaxLifeSeconds is based upon the
>> creation
>> of the key, regardless of how many accesses it has.  I would like to keep
>> an
>> object in the cache until it stops being used.
>> 
>> Is there anyway to configure JCS to do this?  
> 
> The element attribute setting is called IdleTime.
> 
> Bye, Thomas
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jcs-users-help@jakarta.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Item-lifespan-based-on-last-access--tp20928001p20942360.html
Sent from the JCS - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jcs-users-help@jakarta.apache.org


Re: Item lifespan based on last access?

Posted by Thomas Vandahl <tv...@apache.org>.
cj22 wrote:
> I was wondering if there was a way to keep an item in the cache alive based
> on its access time.  Currently the MaxLifeSeconds is based upon the creation
> of the key, regardless of how many accesses it has.  I would like to keep an
> object in the cache until it stops being used.
> 
> Is there anyway to configure JCS to do this?  

The element attribute setting is called IdleTime.

Bye, Thomas

---------------------------------------------------------------------
To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jcs-users-help@jakarta.apache.org