Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The solution to the failure of Internal call in Spring @ Cacheable Annotation Class

2025-03-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

In this issue, the editor will bring you solutions to the failure of internal calls to the Spring @ Cacheable annotation class. The article is rich in content and analyzes and describes it from a professional point of view. I hope you can get something after reading this article.

The internal call to the @ Cacheable annotation class is invalid

If you just want to use a lightweight caching scheme, you can try using the Spring cache scheme.

Then when using the spring @ Cacheable annotation, note that if the method f () of class An is annotated with @ Cacheable, then @ Cacheable does not work when other methods of class A, such as f2 (), call f () directly, because @ Cacheable is based on the spring aop proxy class, f2 () belongs to the internal method, and does not use the proxy when calling f () directly.

For example:

@ Cacheable (key = "# entityType", value = "xxxCache") public List

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report