In my application, I get values from captors
Each value has a 5 minute validity. Each read from a captor cost a
lot, so I've tried to put it in the GAE cache

My code (JCache or low level api) is working with the cache as long as
I don't use the exoiration delay.
When I use the expiration delay, it works fine as long as the
expiration delay isn't spent. After, a get(key) on the cache always
gives null and a put(key,value) doesn't change that.
The same problem seems to be describded here
http://groups.google.com/group/google-appengine-java/browse_thread/thread/4e562762f13d932e/a974365a918b279d?lnk=gst&q=JCache+expiration&pli=1
and in other messages on the web
Here is a view of my code on the low level API
key = num;
foo = (String)cache.get(key);
if (foo == null) {
         foo = ..../* get the value */
        cache.put(key, foo, exp,  MemcacheService.SetPolicy.SET_ALWAYS);
}
resp.setContentType("text/xml");
resp.getOutputStream().print(foo);                      }

where exp is declared as a global by
        static Expiration exp = Expiration.byDeltaSeconds(300);

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to