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 2020/01/19 03:26:45 UTC

[GitHub] [incubator-shardingsphere] KomachiSion commented on issue #4002: Transactions cannot be rolled back properly when using local transaction.

KomachiSion commented on issue #4002: Transactions cannot be rolled back properly when using local transaction.
URL: https://github.com/apache/incubator-shardingsphere/issues/4002#issuecomment-575962836
 
 
   > After debugging, I found that excluding or not excluding JtaAutoConfiguration made a big difference.
   > 
   > **Don’t exclude JtaAutoConfiguration, use JtaTransactionManager.**
   > 
   > When commit:
   > 1、org.springframework.transaction.support.AbstractPlatformTransactionManager#commit
   > 2、org.springframework.transaction.jta.JtaTransactionManager#doCommit
   > 3、com.atomikos.icatch.jta.UserTransactionManager#commit
   > 
   > **Exclude JtaAutoConfiguration, use DataSourceTransactionManager.**
   > 
   > When commit:
   > 1、org.apache.shardingsphere.shardingjdbc.jdbc.core.connection.ShardingConnection#commit
   > 2、org.apache.shardingsphere.transaction.xa.XAShardingTransactionManager#commit
   > 3、com.atomikos.icatch.jta.UserTransactionManager#commit
   > 
   > Does this mean that JtaAutoConfiguration must be excluded to ensure that sharding-jdbc controls the commit or rollback ? @cherrylzhao
   
   If you want to use ShardingSphere XA, you need to exclude `JtaTransactionManager`. Because `JtaTransactionManager` will shutdown the Transaction control of ShardingSphere.
   
   If use local or base of ShardingSphere, `JtaTransactionManager` can be excluded or not.
   
   > Currently, do we have to develop the @ShardingTransactionType aspect by ourselves?
   
   There is no need to develop @ShardingTransactionType by yourself. But only you should clone the `shardingsphere-spi-impl` repo and install by yourself.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services