question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Deprecate ChainedTransactionManager [DATACMNS-1817]

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

13reactions
OrangeDogcommented, May 25, 2021

So what should we do when we need to use multiple DataSources in a single @Transactional section? This was the simplest configuration when inconsistent rollbacks (i.e. one commits while another rolls-back) were not an issue. Can an example be provided?

8reactions
idkwcommented, Jan 21, 2022

I agree, deprecating stuff without providing a clear migration path (with examples before/after) is not cool

Read more comments on GitHub >

github_iconTop Results From Across the Web

ChainedTransactionManager (Spring Data Core 3.0.0 API)
Deprecated. since 2.5. PlatformTransactionManager implementation that orchestrates transaction creation, commits and rollbacks to a list of delegates. Using ...
Read more >
Kazuro Fukuhara on Twitter: "答えるものなし。 ??? https://t.co ...
Mark Paluch opened DATACMNS-1817 and commented ChainedTransactionManager is the primary class in org.springframework.data.transaction that is used for multi- ...
Read more >
spring - Transaction Management across two data sources ...
Why Spring ChainedTransactionManager is deprecated? Do spring provides any alternative lib to support multiple transaction managers?
Read more >
changelog.txt
#2232 - Deprecate ChainedTransactionManager [DATACMNS-1817]. * #2217 - Convert Vavr Seq to ... DATACMNS-1781 - Move off deprecated Spring Framework API.
Read more >
How to use multiple datasources with SpringBoot + Exposed ...
Spring provides a ChainedTransactionManager which can take multiple transaction ... Deprecate ChainedTransactionManager [DATACMNS-1817] · Issue #2232 ·…
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found