To answer one of my questions, apparently makePersistentAll() does
indeed batch save entities.

One remaining question I have is, calling entrySet() on my cache to
get every entity saved in the cache and passing that to
makePersistentAll() is fine; however, the api docs state: "If the map
is modified while an iteration over the set is in progress the results
of the iteration are undefined". My cache is updated very frequently
so the map will be modified. So how do you prevent this from happening
and persist each entity in the cache to the datastore?

Thanks


On Oct 1, 11:45 am, mscwd01 <mscw...@gmail.com> wrote:
> Hey
>
> In an effort to reduce the number of datastore PUTs I am consuming I
> wish to use the memcache much more frequently. The idea being to store
> entities in the memcache for n minutes before writing all entities to
> the datastore and clearing the cache.
>
> I have two questions:
>
> Is there a way to batch PUT every entity in the cache? I believe
> makePersistentAll() is not really batch saving but rather saving each
> individually is it not?
>
> Secondly is there a "callback" function you can place on entities as
> you place them in the memcache? I.e. If I add an entity to the cache
> (with a 2 minute expiration delta) can I tell AppEngine to save the
> entity to the datastore when it is evicted?
>
> 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.

Reply via email to