Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

有某些未通过方法中申明形参的数据进行了查询(如租户id,数据权限之类),此时key中不包含此类数据,可能导致不同租户之间缓存污染 #948

Open
qiaoshujie opened this issue Nov 27, 2024 · 1 comment

Comments

@qiaoshujie
Copy link

问题:现在通过切面在Mybatis-plus的query方法中添加了租户id,但是方法的形参中是未申明租户id的,此时缓存的key是不携带租户id值的,那么可能a租户和b租户在相同参数时会同用一份缓存数据。

我目前的处理:目前自定义了KeyConverter,可以实现将租户id拼接到key中,避免了公用同一份缓存数据。但依然存在的问题是,如果使用了 @cacherefresh,在重新缓存原始数据时,并不会解析key中的租户id

需求:能否在重新获取原始数据的loader中增加一个周期函数,函数中可以对key进行一定的处理

@baklpc
Copy link

baklpc commented Dec 20, 2024

无解……

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants