Java: XA Transaction propagation within many threads

前端 未结 3 2086
离开以前
离开以前 2021-02-06 16:01

How can I use a transaction manager (such as Bitronix, JBoss TS or Atomikos) in a Java SE (not Java EE or Spring) to support the following use case:

Let\'s assume we hav

3条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-06 16:19

    How about you

    1. BEGIN_TRANSATION: Connect to all 3 databases in your Service,
    2. pass the Connection objects (instead of db object) to MyRunnable
    3. END_TRANSACTION: invoke commit and close on all 3 connections in your Service

提交回复
热议问题