jetcache
jetcache copied to clipboard
必须要关闭 devtools 吗?
@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) {
}
代码如上,多次调用 updateUserChild
和 getUserChild
后,发现缓存不再更新,前几次正常。
查看 redis 发现,updateUserChild
不再清理缓存,同时 log 中出现 cast 异常。
-parameters
参数在 plugin 和 idea 中都有添加,问题依旧。
关闭 devtools 就正常了。
开发中,是否必须要关闭 devtools 呢?
jetcache-starter-redis 版本 2.5.14
以前有人报告过类似的问题,曾经改过一次,后来就没听说了。
你要是不行就先关了吧。
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.
https://github.com/alibaba/jetcache/issues/85 in 2.5.6 version fix.
Is the version 2.5.6 invalid or an error after testing
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.
ok
Is there a big change from 2.5 to 2.6
see: https://github.com/alibaba/jetcache/blob/master/docs/EN/Compatibility.md
or https://github.com/alibaba/jetcache/blob/master/docs/CN/Compatibility.md