yanghao888 commented on issue #18008:
URL: 
https://github.com/apache/shardingsphere/issues/18008#issuecomment-1144541061

   I also had the same problem. The version I am using is as follows:
   ```
   <parent>
     <groupId>org.springframework.boot</groupId>
     <artifactId>spring-boot-starter-parent</artifactId>
     <version>2.6.7</version>
     <relativePath/> <!-- lookup parent from repository -->
   </parent>
   ```
   ```
   <dependency>
     <groupId>org.apache.shardingsphere</groupId>
     <artifactId>shardingsphere-jdbc-core-spring-boot-starter</artifactId>
     <version>5.1.1</version>
   </dependency>
   <dependency>
     <groupId>mysql</groupId>
     <artifactId>mysql-connector-java</artifactId>
     <version>8.0.28</version>
     <scope>runtime</scope>
   </dependency>
   ```
   Through the debug mysql driver source code, it is found that this is related 
to a useLocalSessionState parameter. I noticed that the default value of this 
parameter is false in the mysql official document. However, in the 
shardingsphere 5.1.1 version, there is such a piece of code to set this 
parameter value.
   
   
![image](https://user-images.githubusercontent.com/35357351/171575191-47992a53-b77f-45ac-94eb-ea791838e245.png)
   
   Similar code exists in both classes.
   
![image](https://user-images.githubusercontent.com/35357351/171575405-cbe6146b-6f1f-42c4-b432-f72bbd1fabd4.png)
   
   These behaviors of modifying database-driven parameter values are not found 
in shardingsphere 5.0.0. Is there any reason for this?
   
   I tried to modify the parameter value like below, and then Spring's 
transaction rollback behavior took effect normally.
   
   
![image](https://user-images.githubusercontent.com/35357351/171577102-79323e40-4a73-4b29-86fb-8f38f70ba359.png)
   
   So can the code that sets this parameter value be changed to false?
   
   
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to