Never mind, after realising you were using the low level
MemcacheService all makes sense :)

I shall probably try and use this strategy, thanks!

On Oct 3, 10:29 pm, mscwd01 <mscw...@gmail.com> wrote:
> That's a shame, it's a real disadvantage not having that simple
> functionality.
>
> Thanks for your example, although I found it a little difficult to
> understand it completely. Are you suggesting having an entry in the
> cache with a key string "allKeys" which maps to a List of keys
> belonging to all the other entities in the cache? Would this allow me
> to iterate through the keys, saving the entity to the datastore and
> then removing the entry from the cache?
>
> Also what is the "putIfUntouched" statement for?
>
> Thanks again
>
> On Oct 3, 9:51 pm, Bruno Fuster <brunofus...@gmail.com> wrote:
>
>
>
>
>
>
>
> > I don't think so.
>
> > You could create a key with all entities ids that need to be updated.
>
> > Something like:
>
> > public void saveEntity() {
>
> >     cache.put(key, entity);
> >     queue.add(withUrl("/entitiesToUpdate?id="+entity.getId()));
>
> > }
>
> > and then
>
> > public void entitiesToUpdate(Long id) {
>
> >   IdentifiableValue i = cache.getIdentifiable("allKeys");
> >   List<Long> keys = i.getValue();
> >   keys.add(id);
>
> >   boolean put = cache.putIfUntouched("allKeys", i, keys);
> >   if (!put) {
> >        //response 409 for conflict due to concurrency so appengine will
> > retry this later
> >   }
>
> > }
> > On Mon, Oct 3, 2011 at 5:38 PM, mscwd01 <mscw...@gmail.com> wrote:
> > > Hey
>
> > > How would one return all the values stored within the memcache?
> > > I have tried using entrySet() and values() methods on the cache but
> > > both result in an java.lang.UnsupportedOperationException.
>
> > > Ideally, I need to return all the entities stored within the cache and
> > > bulk save them to the datastore - is this possible?
>
> > > Thanks
>
> > > --
> > > 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
> > > google-appengine-java@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > google-appengine-java+unsubscr...@googlegroups.com.
> > > For more options, visit this group at
> > >http://groups.google.com/group/google-appengine-java?hl=en.
>
> > --
> > Bruno Fuster

-- 
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 google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to