You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/08/13 13:04:43 UTC
[GitHub] [shardingsphere] jianliu commented on issue #11583: transaction statement commit error while using shared thread pool and local transaction manager
jianliu commented on issue #11583:
URL: https://github.com/apache/shardingsphere/issues/11583#issuecomment-898443415
I have make a mistake when analyz the reason,because of missing an important info,between pre tps and next tps.
```
#first statements
set autocommit=false -- sql1:thread1
select * from tablexx where sharding_key=? -- sql2:thread2
update tablexx set x=x where sharding_key=? -- sql3:thread3
commit -- sql4:thread4
context.flush
close resources because there is no transaction yet after commit
#the second sql by framework (hikari)
set autocommit=true-- sql1:thread10 this sql is request by datasource framework when connection is close(back to pool)
context.flush
close resources because there is no transaction at all
#the thrid statement
set autocommit=false -- sql1:thread6
select * from tablexx where sharding_key=? -- sql2:thread7
```
Here is the logs:
![image](https://user-images.githubusercontent.com/1589099/129360520-156f26e7-3960-47f9-b844-cdab850554c4.png)
The second sql (setAutoCommit(true) between the first and the thrid statement send by framework cause this erorr,because it removes the third sql(setAutoCommit:false) `s connectionPostProcessor,and lead this error finally
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org