简体   繁体   English

在休眠状态下更新多条记录的查询缓存

[英]Update Query Cache in hibernate for multiple records

Second level query cache is enabled and I am executing update query which is updating more than two records of that entity in DB.启用了二级查询缓存,我正在执行更新查询,该查询正在更新数据库中该实体的两条以上记录。
1) Is that reflected in second level cache for that entities? 1)这是否反映在该实体的二级缓存中?
2) If they are getting cached then those entities are accessed through non-query(entity level) cache ? 2)如果它们被缓存,那么这些实体是通过非查询(实体级)缓存访问的?

Any query that you have with that entity type will be invalidated whenever there's an update or insert on that entity type.每当对该实体类型进行更新或插入时,您对该实体类型的任何查询都将失效。 This means that the query and its results get removed from the query cache, and the next time the query is executed after the update it'd be cached again.这意味着查询及其结果从查询缓存中删除,下次更新后执行查询时,它会再次缓存。 You can find a few more details in this recent response I sent.您可以在我最近发送的回复中找到更多详细信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM