liuyangming commented on issue #2902: When shardingjdbc is integrated with 
spring, it‘s not compatible with the declarative transactions.
URL: 
https://github.com/apache/incubator-shardingsphere/issues/2902#issuecomment-523364349
 
 
   > > I have reviewed your demo, I think you should forget JTA configuration 
in sharding-transaciton.
   > > sharding transaction can simply integrate with spring 
DataSourceTransactionManager.
   > > we have developed a experimental spring starter before, you can refer it 
in 
[sharding-transaction-spring](https://github.com/OpenSharding/shardingsphere-spi-impl/tree/master/sharding-spring),
 and 
[here](https://github.com/OpenSharding/shardingsphere-spi-impl-example/tree/master/transaction-example/transaction-2pc-xa-example)
 is example
   > > hope this will help you.
   > 
   > The 
[shardingjdbc-sample](https://github.com/liuyangming/shardingjdbc-sample/tree/issue-2902)
 does not use the JTA configuration. The GenericConfiguration(the class with 
JTA configuration) is not added the @configuration annotation, and is not 
imported by ShardingJdbcSampleBootstrap(the main class). In fact, it does not 
take effect in the default scenario(only ShardingConfiguration is effect), you 
can ignore it. The 
[shardingjdbc-sample](https://github.com/liuyangming/shardingjdbc-sample/tree/issue-2902)
 keep it just to do a comparison with a standard xa-data-source when needed.
   
   In fact, the 
[shardingjdbc-sample](https://github.com/liuyangming/shardingjdbc-sample/tree/issue-2902)
 is written with reference to 
[transaction-sample](https://github.com/apache/incubator-shardingsphere-example).
 The only difference between them is that it didn't add the 
@ShardingTransactionType(TransactionType.XA) annotation in the service, and 
even if this annotation is added, it is also incompatible with the declarative 
transaction.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to