Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
488 views
in Technique[技术] by (71.8m points)

mybatis集群时怎么保证一级缓存的时效性?

mybatis默认开始了一级缓存,那么在集群环境或分布式环境中,它是怎么保证缓存之间的同步呢?假设我在A节点上查询了到数据X=a,此时B节点上对数据X进行了修改,改成X=b,那么此时A节点上查询到了缓存X=a,那岂不是会出现脏读?那是否说,如果是在集群/分布式环境中使用到mybatis,一定要与第三方的缓存框架进行集成呢?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

mybatis的一级缓存无法支持分布式,必须与第三方框架集成


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...