You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "FlyingZC (via GitHub)" <gi...@apache.org> on 2023/03/07 14:07:25 UTC

[GitHub] [shardingsphere] FlyingZC commented on issue #24472: @Transactional not work with sharding-jdbc 5.1.2

FlyingZC commented on issue #24472:
URL: https://github.com/apache/shardingsphere/issues/24472#issuecomment-1458236035

   I tested that transaction exceptions in version 5.3.1 can be rolled back normally, please update the version.
   ```java
     @Transactional(rollbackFor = Exception.class)
     public void saveFailed() throws Exception {
         orderMapper.insert(createOrderEntity(1L, 1L));
         orderMapper.insert(createOrderEntity(2L, 2L));
         orderMapper.insert(createOrderEntity(3L, 3L));
         orderMapper.insert(createOrderEntity(4L, 4L));
         if (true) {
             throw new Exception("mock exception");
         }
     }
   ```


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