lets say that in SparkCache I have value named "cachedVal", how can I replace it instead of remove and put it again? I mean how can I made atomic request to cache? Because now if I have 1kk users and everyone makes something like this:
if(cache.get("cachedVal") != null)
I get a lot of crashes because they in the same time make remove and put requests. Is there any solution for atomic cache request or to solve this problem?
A lock will be relinquished either when it is explicitly released using Spark.unlockKey, or upon termination of the script.
This includes a scenario where your script encounters a fatal error before that explicit call.