One of you master the cache tag analysis in mybatis secondary cache source code

Home > Sci-Tech

One of you master the cache tag analysis in mybatis secondary cache source code

2021-11-26 06:04:29 16 ℃

There is a picture below: The cache is built on the level cache. When receiving the query request, mybatis will query the ⼆ level cache, if the class is cached, then query the first level cache, the first level is not , Query the database. The order is the secondary cache - "First Class Cache ---" Database

Different from the first level cache, the cache and the specific namespace binding, a cache in a mapper, a CACHE in the same mappe, and the first-level cache is bound to SQLSession. A mapper may have multiple SQLSession, but there is only one cache.

copy code Configuring tag Copy code Configure usecache = true