Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Ehcache TimeToLiveSecond and TimeToIdleSeconds

 
Ganesh Shirsat
Ranch Hand
Posts: 33
Google Web Toolkit Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

1.What is the meaning of TimeToLiveSecond and TimeToIdleSecond.?
2. is they are removed, object from cache?

I tried one example.
TimeToLive = 1200
TimeToIdle = 15

I load the two object in cache first time.

i access the object after 30 second .
before accessing the object. I print the statistics of Cache and it was still show me a two object in cache.
but when i was actually access the object it was fetch from database instead of cache.

that's mean object are expired but they are still in cache still we access the object again or memory is overflow.

is the above paragraph right?

Thanks ,
Ganesh Shirsat




 
Yagnesh N Chawda
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think we should not use it together. May be this is of some help : https://jira.terracotta.org/jira/browse/FORGE-270

 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
timeToLiveSecond is the time in seconds from the point of creation in the cache till it expires (regardless of how frequently it is accessed in that time)

timeToIdleSeconds is the time in seconds before an object in the cache expires if it is not accessed.

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic