Zze0 opened a new issue #4002: Transactions cannot be rolled back properly when 
using local transaction.
URL: https://github.com/apache/incubator-shardingsphere/issues/4002
 
 
   ## Bug Report
   
   **For English only**, other languages will not accept.
   
   Before report a bug, make sure you have:
   
   - Searched open and closed [GitHub 
issues](https://github.com/apache/incubator-shardingsphere/issues).
   - Read documentation: [ShardingSphere 
Doc](https://shardingsphere.apache.org/document/current/en/overview).
   
   Please pay attention on issues you submitted, because we maybe need more 
details. 
   If no response **more than 7 days** and we cannot reproduce it on current 
information, we will **close it**.
   
   Please answer these questions before submitting your issue. Thanks!
   
   ### Which version of ShardingSphere did you use?
   4.0.0-RC2
   
   ### Which project did you use? Sharding-JDBC or Sharding-Proxy?
   Sharding-JDBC
   
   ### Expected behavior
   
https://shardingsphere.apache.org/document/current/en/features/transaction/function/local-transaction/
   
![image](https://user-images.githubusercontent.com/59901940/72581051-f6c00880-3918-11ea-8fe2-2b727603dc10.png)
   
   
   ### Actual behavior
   1, The insert is committed directly.
   2, Local transaction cannot be rolled back after a null pointer exception is 
thrown.
   
   Example code:
   
![image](https://user-images.githubusercontent.com/59901940/72581279-c4fb7180-3919-11ea-82cb-f5e967c5ee0a.png)
   
   ### Reason analyze (If you can)
   Distributed transactions are enabled after the sharding-transaction-xa-core 
package is imported into the project.
   The reason for the insert is directly committed is probably because the 
autoCommit property of the ShardingConnection class defaults to true and then 
returns false in the isHoldTransaction function of the ShardingConnection class.
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule 
configuration, when exception occur etc.
   Please see the sample code below.
   
   ### Example codes for reproduce this issue (such as a github link).
   https://github.com/Zze0/demo-sharding-jdbc

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to