Found a solution by using a different API:

MemcacheService  cache = MemcacheServiceFactory.getMemcacheService();

Rest of the code is the same.

Actually documentation of app engine has some shortcomings on this
topic. I have passed 2 days trying to find a solution and finaly found
it in O'Reilly's book on app engine.

BR,
Lennart



On 5 nov, 16:52, Lennart Benoot <[email protected]> wrote:
> Just to be clear, this is already happening after 1 minute. Should I fill in
> an expiration date? Documentation says that if no default is given, cache is
> heald in memory as long as possible. Amount of data in cache is limited
> also...
>
> BRL
>
> On 5 November 2010 16:31, alesj <[email protected]> wrote:
>
>
>
>
>
>
>
> >http://code.google.com/appengine/docs/java/memcache/overview.html
>
> > >> Values can expire from the memcache at any time, and may be expired
> > prior to the expiration deadline set for the value.
>
> > All looks fine, but like it says, cached value can go away at any
> > time.
> > Which is probably what's happening in your case.
>
> > On Nov 5, 1:45 pm, Lennart Benoot <[email protected]> wrote:
> > > Hi all,
>
> > > I'm trying to implement Memcache but without success so far. I have
> > > difficulties finding examples containing fully working code so I tried
> > > to construct based on what I could find. Here's the code to get a
> > > reference to the cache:
>
> > > cache= CacheManager.getInstance().getCache("fourturemark");
> > > if (cache == null) {
> > > cache =
>
> > CacheManager.getInstance().getCacheFactory().createCache(Collections.emptyM 
> > ap());
> > > CacheManager.getInstance().registerCache("fourturemark", cache);
>
> > > }
>
> > > If I'm right, this code should return the cache in case it already
> > > exists. However, based on performance, I see that data stored in cache
> > > is reloaded from resource instead of cache.
>
> > > Any idea what I'm doing wrong here?
>
> > > BR,
> > > Lennart
>
> > --
> > 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]<google-appengine-java%2B 
> > [email protected]>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-appengine-java?hl=en.

-- 
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