liuyangming commented on issue #2854: modify the enlistment to support the transaction propagation REQUIRES_NEW URL: https://github.com/apache/incubator-shardingsphere/pull/2854#issuecomment-521242297 > I see, REQUIRES_NEW works on different connection to support new transaction. forward the enlistResource to TM can indeed solve this problem. but in ShardingSphere there also have some scenarios that getting multiple connections from one datasource, we should avoid to enlist same XAResource(same datasourceName) more than once. Under normal circumstances, this will not be a problem, because the connection sharing mechanism of the connection pool component will ensure that the same physical connection will be used for multiple getConnections within a transaction, and will not cause multiple enlistments. However, I read the connection management implementation of shardingsphere, Since it encapsulates connection pool, the connection pool can't interact with TM, so it really needs to solve this problem by itself, and it also causes shardingsphere cannot support REQUIRES_NEW transaction propagation level. It seems that this problem cannot be resolved by forwarding the enlistment. Btw, closing the ShardingConnection will cause the TransactionType changed, this is really unacceptable. It is impossible for the business system to manually change the TransactionType every time. It is expected that the implementation of subsequent versions will be more standardized, otherwise integration with business systems will be difficult.
---------------------------------------------------------------- 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
