asolfre / objectify-appengine

Automatically exported from code.google.com/p/objectify-appengine
MIT License
0 stars 0 forks source link

cache - expiration of entities - not working #174

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
just created the following entity class:

@Entity
@Cache(expirationSeconds=60)
public class Session {

    @Id 
    String id;

    @Index
    Date created;

    @Serialize 
        Map<String,Object> attributes = new HashMap<String,Object>();

...

}

after saving one entity to googles cache:

Session session = new Session();
Key<Session> sess = ofy().save().entity(session).now();

it is still accessible after 10minutes and it's viewable in the Googles 
memcache viewer.

objectify-4.0rc1.jar

Original issue reported on code.google.com by j...@formigas.de on 14 Aug 2013 at 8:38

GoogleCodeExporter commented 9 years ago
It is likely that cache expiration is enforced on get() rather than when you 
enumerate the contents, so you are seeing a quirk of the internal 
implementation of memcache expiration. You will almost certainly see this same 
behavior using MemcacheService directly - and if so, you might want to raise 
the issue with Google.

I added a test case to prove that cache expires (see 
CachingTests.cacheExpirationWorks()) and it passes, so I feel pretty confident 
that Objectify is doing the right thing. I'm guessing the problem is with the 
memcache viewer, not with actual expiration.

Original comment by lhori...@gmail.com on 19 Oct 2013 at 6:57