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-523451601
 
 
   > and you can use `DataSourceUtils.getConnection(shardingDataSource)` in 
your biz code to get the connection managed by @transactional, I have tested it.
   
   I have added the sharding-transaction-jdbc-spring dependency and solved the 
problem after getting the connection through 
DataSourceUtils.getConnection(DataSource). However, I still think that the 
operation of getting the connection through DataSourceUtils should be 
encapsulated by shardingjdbc instead of the business system. Of course, this is 
my personal opinion and is for reference only.
   
   Another problem is that the support for transaction propagation level 
REQUIREDS_NEW of declarative transactions is still incorrect. I have updated to 
the 
[shardingjdbc-sample](https://github.com/liuyangming/shardingjdbc-sample/tree/issue-2902),
 the latest code can reproduce this problem. The DataSourceTransactionManager 
has no problem with the begin & commit/rollback control of the transaction. 
However, the completion of the two transactions involved is confusing.

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