• New Feature
  • Status: Open
  • 2 Major
  • Resolution:
  • ehcache-terracotta
  • prodmgmt
  • Reporter: dhreines
  • January 11, 2010
  • 0
  • Watchers: 1
  • January 18, 2011

Description

I’d like to have more control over TTL/TTI in a particular JVM.

Here’s the scenario that outlines the need.

I have an application (app1) accepting frequent messages (let’s say every minute) that update a cached object. The plan is to cache that object via ehcache.

I also have a web based application (app2) that reads this same data. While the web users are viewing this object, they will want to see the updates made by app1 as they occur. So, automatically receiving the updates made by app1 via terracotta clustering works perfectly. No special code needed, both apps are sharing the same object and the object is now faulted into app2. The next time app2 reads the object, it will display the most recent values.

The problem I’m facing, is that after the user has logged out/session expires, I no longer want the object faulted into the webapp’s jvm. I’d like some way to remove that object from the app2 jvm. Howerver, I do not want to remove the object from app1 since it will continue to receive updates every minute. Not removing the object from app2 leads to unnecessary cpu and memory consumption.

It’d be nice to have greater control over the expiration of values within apps and/or jvms. For example, having different tti/ttl per app or jvm. In this case, I could set the tti value for app2 to be different than that of app1. And, when the object expired in the webapp jvm, it would remove that object from only that jvm, thus the jvm would no longer receive updates. Yet, the object will still be faulted into app1.

Here’s a link to a related forum discussion http://forums.terracotta.org/forums/posts/list/2924.page#16910

Comments

Fiona OShea 2010-03-24

Mike to follow up with David