On Oct 28, 1:39 am, dburns <[email protected]> wrote:
>
> If those two concurrent instances both instead call:
>
> cached_obj=memcache.get("my_key")
>
> and get a result back from some earlier:
>
> memcache.add("my_key", my_object)
>
> are they susceptible to the same sort of collision if each instance does
> something like:
>
> cached_obj.counter += amount?
Yes.
However, there is an atomic memcache.incr('my_key'). So in the
specific case of incrementing an integer, as in your example, memcache
is safe when you use the builtin 'incr' and 'decr' functions. But in
the general case - for example if you wanted to append a string to a
memcached value - then no, memcache has no transactional capability.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google App Engine" 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?hl=en
-~----------~----~----~----~------~----~------~--~---