michael-m-pro opened a new issue, #28451:
URL: https://github.com/apache/shardingsphere/issues/28451

   ## 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/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 anymore and we cannot reproduce it on current information, we 
will **close it**.
   
   environment:
    shardingSphere proxy:5.4.0
    spring cloud: 2022.0.0
    mysql:8.0.28
   
   server.yaml info:
   authority:
     users:
       - user: root@%
         password: root
       - user: sharding
         password: sharding
     privilege:
       type: ALL_PERMITTED
   
   transaction:
     defaultType: LOCAL
   
   sqlParser:
     sqlCommentParseEnabled: false
     sqlStatementCache:
       initialCapacity: 2000
       maximumSize: 65535
     parseTreeCache:
       initialCapacity: 128
       maximumSize: 1024
   
   logging:
     loggers:
     - loggerName: ShardingSphere-SQL
       additivity: true
       level: INFO
       props:
         enable: false
   
   sqlFederation:
     sqlFederationEnabled: false
     executionPlanCache:
       initialCapacity: 2000
       maximumSize: 65535
   
   props:
     system-log-level: INFO
     max-connections-size-per-query: 1
     kernel-executor-size: 16  # Infinite by default.
     proxy-frontend-flush-threshold: 128  # The default value is 128.
     # sql-show is the same as props in logger ShardingSphere-SQL, and its 
priority is lower than logging rule
     sql-show: true
     proxy-opentracing-enabled: 
     proxy-hint-enabled: false 
   
   code:
           @Transactional(rollbackFor = Exception.class)
        public BaseResult<CustomerResDTO> update(@RequestBody CustomerReqDTO 
customerReqDTO) throws Exception {
                BaseResult<CustomerResDTO> result = new BaseResult<>();
                CustomerDO customerDO = 
objectConversion.copy(customerReqDTO,CustomerDO.class);
                customerDO = customerService.get(customerDO);
                customerDO.setRemark("222");
                customerService.update(customerDO);
                if(true){
                        throw new Exception("test");
                }
                customerDO.setRemark("333");
                customerService.update(customerDO);
                CustomerResDTO customerResDTO 
=objectConversion.copy(customerDO,CustomerResDTO.class);
                result.setData(customerResDTO);
                return result;
        }
   
   issue:
   When the sharding proxy transaction is configured as LOCAL, the spring 
annotation transaction (@Transactional(rollbackFor = Exception.class)) is used 
in the project. When an exception is thrown in the transaction method, the data 
cannot be rolled back normally.
   
   
   Please answer these questions before submitting your issue. Thanks!
   
   ### Which version of ShardingSphere did you use?
   5.4.0
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-Proxy
   ### Expected behavior
   transaction rolled back
   ### Actual behavior
   transaction not rolled back
   ### Reason analyze (If you can)
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule 
configuration, when exception occur etc.
   
   ### Example codes for reproduce this issue (such as a github link).
   
   


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