I'd like to atomically add a new key to google appengine's memcache service using the Java API. This means that the put operation should fail (e.g. throw an exception or return false
) if the key is already present in the memcache, preventing concurrent additions (which would result in overwriting) to the memcache.
I don't see how this can be accomplished with the getIdentifiable
/ putIfUntouched
pair of methods. Also, synchronize
does not help because I want control concurrency across different instances of my servlet.