Skip to content

Instantly share code, notes, and snippets.

@wburns
Created September 4, 2015 16:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wburns/25f4c9a5c879471e51ef to your computer and use it in GitHub Desktop.
Save wburns/25f4c9a5c879471e51ef to your computer and use it in GitHub Desktop.
// start transaction before this
Integer count = cache.getAdvancedCache().withFlags(Flag.FORCE_WRITE_LOCK).get(key);
cache.put(key, count+1);
// commit or rollback transaction depending on state
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment