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 2022/06/02 11:09:04 UTC

[GitHub] [shardingsphere] dragonorant commented on issue #18008: springboot 2.6.3 and shardingsphere 5.1.1 , transaction do not roll back

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

   > 我也有同样的问题。我使用的版本如下:
   > 
   > ```
   > <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>
   > ```
   > 
   > 通过调试mysql驱动源码,发现这与一个useLocalSessionState参数有关。我注意到mysql官方文档中这个参数的默认值为false。但是在shardingsphere 5.1.1版本中,有这么一段代码来设置这个参数值。
   > 
   > ![图片](https://user-images.githubusercontent.com/35357351/171575191-47992a53-b77f-45ac-94eb-ea791838e245.png)
   > 
   > 两个类中都存在类似的代码。 ![图片](https://user-images.githubusercontent.com/35357351/171575405-cbe6146b-6f1f-42c4-b432-f72bbd1fabd4.png)
   > 
   > shardingsphere 5.0.0 中没有这些修改数据库驱动参数值的行为。这有什么原因吗?
   > 
   > 我尝试如下修改参数值,然后Spring的事务回滚行为正常生效。
   > 
   > ![图片](https://user-images.githubusercontent.com/35357351/171577102-79323e40-4a73-4b29-86fb-8f38f70ba359.png)
   > 
   > 那么设置这个参数值的代码能不能改成false呢?
   
   Thank you for your advice


-- 
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