jetcache icon indicating copy to clipboard operation
jetcache copied to clipboard

必须要关闭 devtools 吗?

Open TshineZheng opened this issue 4 years ago • 8 comments

    @Override
    @Transactional
    @CacheInvalidate(name = "child4user::", key = "#child.getOwnerUserId()")
    public boolean add(Child child) {
    }

    @Override
    @Cached(name = "child4user::", key = "#userId", cacheType = CacheType.BOTH)
    public List<ChildVo> getUserChild(String userId) {
    }

    @Override
    @Transactional
    @CacheInvalidate(name = "child4user::", key = "#userChild.getUserId()")
    public boolean updateUserChild(UserChild userChild) {
    }

    @Override
    @Transactional
    @CacheInvalidate(name = "child4user::", key = "#userId")
    public boolean removeUserChild(String userId, String childId) {
    }

代码如上,多次调用 updateUserChildgetUserChild 后,发现缓存不再更新,前几次正常。 查看 redis 发现,updateUserChild 不再清理缓存,同时 log 中出现 cast 异常。 -parameters 参数在 plugin 和 idea 中都有添加,问题依旧。 关闭 devtools 就正常了。

开发中,是否必须要关闭 devtools 呢?

jetcache-starter-redis 版本 2.5.14

TshineZheng avatar Nov 08 '19 11:11 TshineZheng

以前有人报告过类似的问题,曾经改过一次,后来就没听说了。

你要是不行就先关了吧。

areyouok avatar Nov 08 '19 15:11 areyouok

I have the same problem: error log: Caused by: java.lang.ClassCastException: class xxxxx.App cannot be cast to class xxxxx.App (xxxxx.App is in unnamed module of loader org.springframework.boot.devtools.restart.classloader.RestartClassLoader @7d065827; xxxxx.App is in unnamed module of loader 'app') at spel.Ex2.getValue(Unknown Source) at org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:256) ... 157 more

I use jetcache version is 2.5.15.

andotorg avatar Aug 12 '22 07:08 andotorg

https://github.com/alibaba/jetcache/issues/85 in 2.5.6 version fix.

andotorg avatar Aug 12 '22 07:08 andotorg

Is the version 2.5.6 invalid or an error after testing

andotorg avatar Aug 12 '22 07:08 andotorg

The 2.5 branch is no longer maintained.

if 2.6/2.7 has any problem, please open new issue and give code for reproducing.

areyouok avatar Aug 12 '22 07:08 areyouok

ok

andotorg avatar Aug 12 '22 11:08 andotorg

Is there a big change from 2.5 to 2.6

andotorg avatar Aug 12 '22 11:08 andotorg

see: https://github.com/alibaba/jetcache/blob/master/docs/EN/Compatibility.md

or https://github.com/alibaba/jetcache/blob/master/docs/CN/Compatibility.md

areyouok avatar Aug 12 '22 12:08 areyouok