Description
Mark Paluch opened DATACMNS-1817 and commented
ChainedTransactionManager
is the primary class in org.springframework.data.transaction
that is used for multi-transactionmanager arrangements. It is useful to coordinate transactions across multiple resources especially when one transaction manager is a Spring one and the other is a foreign one.
Over time, we found that we're basically emulating distributed transactions on a best-effort basis with known gaps. These gaps lead to inconsistencies or unexpected behavior during rollbacks. Part of the problem is that resource/synchronization storage is a singleton ThreadLocal
. Using two transaction managers based on AbstractPlatformTransactionManager
causes the first transaction manager to handle all synchronizations regardless of their resource origin (primary and secondary transactional resources). If the second transaction manager commit fails, then already all synchronizations are processed and there's no way to recover.
Therefore, we're going to deprecate ChainedTransactionManager
and the entire org.springframework.data.transaction
that hosts support classes for multi-transactions
Issue Links:
- DATACMNS-370 ChainedTransactionManager should only control transaction synchronization if all delegate transaction managers are set to NOT control synchronization
("supersedes") - DATACMNS-1221 ChainedTransactionManager - Issue with HibernateTransactionManager and KafkaTransactionManager
("supersedes") - DATACMNS-1253 ChainedTransactionManager and Ignite SpringTransactionManager
("supersedes") - DATACMNS-1314 ChainedTransactionManager does not handle transaction sychroriazation correctly
("supersedes") - DATACMNS-1789 Reactive ChainedTransactionManager
("supersedes") - DATACMNS-1604 Support 'afterAllCommit' in ChainedTransactionManager
("supersedes")