linghengqian commented on issue #30242:
URL: 
https://github.com/apache/shardingsphere/issues/30242#issuecomment-1960792383

   > Thanks a lot.I want to ask only question:after integrating 
shardingsphere-seata, in order to rollback,only method is 【Manually obtain the 
java.sql.Connection instance created from the ShardingSphere data source, and 
manually calling rollback() methods】?
   
   - In the context of web frameworks, you can set up rollback through JTA 
annotations, such as `javax.transaction.Transactional`, 
`jakarta.transaction.Transactional` and 
`org.springframework.transaction.annotation.Transactional`. Other JTA 
annotations for local transactions are also available, the only limitation is 
that you cannot use Seata Java APIs like 
`io.seata.spring.annotation.GlobalTransactional`. More elaboration in the 
context of 
https://github.com/apache/shardingsphere/issues/22356#issuecomment-1948463141 .
   
   > 但是这里要注意一个问题!!!!!!
   > 
虽然SeataATShardingTransactionManager和GlobalTransactionScanner做的事情一样,但是二者绝对不能混合使用!!!!!!
   > 
也就是说@ShardingTransactionType(TransactionType.BASE)和@GlobalTransactional绝对不能同时出现!!!!!!
   > 
看过上面SeataATShardingTransactionManager你就能明白,ShardingSphere把获取到的全局事务,放到了线程的局部变量里面了。而GlobalTransactionScanner则是采用动态代理的方式对方法进行增强。根本不能放在一起,杂交是要出问题的!
   > ok!最终总结一句!
   > 只要你的项目中用到sharding-jdbc,那么你全部微服务都需要导入seata整合sharding-jdbc的jar包
   > 
而且,你的项目中千万不能再出现@GlobalTransactional注解了,用SeataATShardingTransactionManager就可以了。
   
   - You cannot set the isolation level of a transaction because this is a 
limitation imposed by Seata-AT.
   - The web frameworks I am talking about include but are not limited to 
Spring Boot OSS, Quarkus, Micronaut and Helidon. Using JTA annotations like 
`javax.transaction.Transactional` requires the existence of an IOC concept.


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