JSR-107 caching annotations

JSR-107 aims to standardize caching annotations. Listed here are some of the important JSR-107 annotations:

  • @CacheResult: Similar to @Cacheable
  • @CacheRemove: Similar to @CacheEvict; ;@CacheRemove supports conditional eviction if an exception occurs
  • @CacheRemoveAll: Similar to @CacheEvict(allEntries=true); used to remove all entries from the cache

JSR-107 and Spring's caching annotations are fairly similar in terms of the features they offer. Either of them is a good choice. We lean slightly toward JSR-107 because it's a standard. However, make sure you are not using both in the same project.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset