In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-10 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 about what the caching mode of iBATIS.net database is. 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 mode of database cache is provided in iBATIS.net, which can improve the efficiency of access. For some tables that are not updated frequently, you can directly take advantage of iBATIS.net caching.
To use iBATIS.net 's database cache, just use the configuration file, which is relatively simple to implement:
< select id= "GetCachedAccountsViaResultMap" resultMap= "account-result" cacheModel= "account-cache" > select * from Accounts order by Account_ID < / select >
The most important thing is cacheModel= "account-cache", which specifies the cache method, as follows, is where the cache is configured:
< cacheModels > < cacheModel id= "account-cache" implementation= "MEMORY" > < flushInterval hours= "24" / > < flushOnExecute statement= "UpdateAccountViaInlineParameters" / > < flushOnExecute statement= "UpdateAccountViaParameterMap" / > < flushOnExecute statement= "InsertAccountViaParameterMap" / > < property name= "Type" value= "Weak" / > < / cacheModel > < / cacheModels >
Among them: implementation= "MEMORY" is the way to set the cache, you can specify LRU, FIFO, etc., which is similar to the memory page replacement strategy. MEMORY is one of the most commonly used methods.
FlushOnExecute sets the cache to be updated when these statements are executed.
After the configuration, I conducted a simple test, which is basically OK, but there is also a problem:
1. The result of the * query is 4 records. When I manually insert a record into the database, the second query is still 4 records.
2. When I changed the system time to the next day (24 hours later), I checked again and got 5 records.
3. When I execute the InsertAccountViaParameterMap statement to insert a record, the query results in six records
In other words, when the tables in the system are never manually maintained and not modified by third-party programs, database caching can be used to improve efficiency.
This is what the caching mode of the iBATIS.net database shared by the editor is. If you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to 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.