838 Star 2.8K Fork 866

GVPJbootProjects / jboot

 / 详情

Controller中使用@Cacheable不能实现正常缓存功能

Backlog
Opened this issue  
2021-06-10 15:14

Controller简略代码:

    @ShiroClear
    @Cacheable(name = "zeroAreaJson")
    public void layuiSelectNmJson() {
        List<LayUiSelectNmVo> vos = new ArrayList<>();
        // area数据读取 数据处理逻辑
        renderJson(vos);
    }

第一次访问日志:

Jboot exec sql taked 0 ms >>>  select * from area where parentId=33
Jboot exec sql taked 0 ms >>>  select * from area where parentId=378
Jboot exec sql taked 0 ms >>>  select * from area where parentId=34
Jboot exec sql taked 1 ms >>>  select * from area where parentId=379

Jboot-3.9.16 action report -------- 2021-06-10 15:04:00 -------------------------
Request     : GET /admin/area/layuiSelectNmJson
Controller  : com.quickplan.bszdormitory.web.admin.AreaController.(AreaController.java:44) ---> invoked √
Method      : layuiSelectNmJson()
Interceptor : com.jfinal.ext.interceptor.SessionInViewInterceptor.(SessionInViewInterceptor.java:44) ---> invoked √
              com.quickplan.bszdormitory.web.interceptor.AdminInterceptor.(AdminInterceptor.java:19) ---> invoked √
              com.quickplan.bszdormitory.web.interceptor.AdminLoginInterceptor.(AdminLoginInterceptor.java:19) ---> invoked √
              io.jboot.support.shiro.JbootShiroInterceptor.(JbootShiroInterceptor.java:31) ---> invoked √
              io.jboot.components.cache.interceptor.CacheableInterceptor.(CacheableInterceptor.java:49) ---> invoked √
Render      : [{"name":"北京","id":1,"children":[{"name":"北京市","id":35,"children":[{"name":"东城区","id":380,"voName":"...
----------------------------------- taked 327 ms --------------------------------

第二次访问日志:

Jboot exec sql taked 0 ms >>>  select * from area where parentId=33
Jboot exec sql taked 0 ms >>>  select * from area where parentId=378
Jboot exec sql taked 0 ms >>>  select * from area where parentId=34
Jboot exec sql taked 1 ms >>>  select * from area where parentId=379

Jboot-3.9.16 action report -------- 2021-06-10 15:04:15 -------------------------
Request     : GET /admin/area/layuiSelectNmJson
Controller  : com.quickplan.bszdormitory.web.admin.AreaController.(AreaController.java:44) ---> invoked √
Method      : layuiSelectNmJson()
Interceptor : com.jfinal.ext.interceptor.SessionInViewInterceptor.(SessionInViewInterceptor.java:44) ---> invoked √
              com.quickplan.bszdormitory.web.interceptor.AdminInterceptor.(AdminInterceptor.java:19) ---> invoked √
              com.quickplan.bszdormitory.web.interceptor.AdminLoginInterceptor.(AdminLoginInterceptor.java:19) ---> invoked √
              io.jboot.support.shiro.JbootShiroInterceptor.(JbootShiroInterceptor.java:31) ---> invoked √
              io.jboot.components.cache.interceptor.CacheableInterceptor.(CacheableInterceptor.java:49) ---> invoked √
Render      : [{"name":"北京","id":1,"children":[{"name":"北京市","id":35,"children":[{"name":"东城区","id":380,"voName":"...
----------------------------------- taked 172 ms --------------------------------

第二次及以后访问依然会读取area数据库

Comments (1)

zeroabc created任务
zeroabc set related repository to JbootProjects/jboot
Expand operation logs

还没修复吗。

Sign in to comment

Status
Assignees
Milestones
Pull Requests
Successfully merging a pull request will close this issue.
Branches
Planed to start   -   Planed to end
-
Top level
Priority
参与者(1)
70370 zeroabc 1578916205
Java
1
https://gitee.com/JbootProjects/jboot.git
git@gitee.com:JbootProjects/jboot.git
JbootProjects
jboot
jboot

Search

181749 a2d7925e 1850385 181749 9f8568a7 1850385