mybatis-3 icon indicating copy to clipboard operation
mybatis-3 copied to clipboard

Query result discrepancy

Open SumStar93 opened this issue 2 years ago • 1 comments

When multiple (dozens) of queries are executed simultaneously, there is an occurrence where a different query result is returned for a specific query. For example, let's say there are query A and query B, and their respective results should be result A and result B, but the following combinations of results are returned: query A: result B query B: result A

The version and other information provided are as follows:

Version: '2.2.0' Implementation group: 'org.mybatis.spring.boot' Name: 'mybatis-spring-boot-starter' Currently, to avoid such issues, we are using 'flushCache=true'.

SumStar93 avatar May 23 '23 12:05 SumStar93

Hello @SumStar93 ,

It sounds like you are sharing some object that is not thread safe between multiple threads. There are some general advices in the following page. https://mybatis.org/spring/using-api.html

If your project is relatively simple and can be shared publicly on your GitHub repo, I would take a look when I have some time.

harawata avatar May 24 '23 00:05 harawata