In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
Most people do not understand the knowledge points of this article "which parts of Jspxcms cache", so the editor summarizes the following content, detailed content, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "which parts of Jspxcms cache" article.
Jspxcms itself does not do special caching. JPA is used in the system, and all caches are handled by JPA. So the cache here is actually the cache of JPA. For more information, check out the caching section of the JPA or Hibernate documentation.
JPA cache is divided into three parts: first-level cache, second-level cache and query cache.
First-level caching is an inherent function of JPA, that is, during a session cycle, the objects in it will be put into the cache. The first-level cache caches only individual objects. In a session cycle, querying the same object multiple times will only read the database once, and then all from the cache. This cache is turned on by default and cannot be turned off.
Secondary cache is a cache shared in multiple session cycles, such as objects queried in one session cycle, and the same object is queried in the next session cycle, which will be read from the cache instead of querying the database. In addition to individual objects, collections of one to many can also be placed in a secondary cache.
The query cache caches the results of sql statements.
What does the session cycle mean? The session here is JPA's session, not http's session. Using JPA generally turns on Open Session In View, that is, a http request is a session cycle.
In JPA, secondary caching and query caching are off by default. These two caches are opened in Jspxcms, configuration file: / WEB-INF/classes/conf/spring.jpa.properties
# second-level cache spring.jpa.properties.hibernate.cache.use_second_level_cache=true# query cache spring.jpa.properties.hibernate.cache.use_query_cache=true
Caching is critical for a system like cms that needs to deal with a lot of access. However, because of the existence of the cache, directly modify the database data manually, the data on the page will not change, you need to restart Tomcat to read the changed data. If caching must be turned off for some reason, you can set both caches to false, but system performance degrades.
The above is about the content of this article on "what are the parts of Jspxcms cache?" I believe we all have a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please follow the industry information channel.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.