Are XA/JTA transactions still used?

前端 未结 2 1684
太阳男子
太阳男子 2021-02-10 08:51

I have an application that interacts multiple databases and some custom services. For some operations, I need transaction-like behavior where a set of changes either commit acro

2条回答
  •  无人共我
    2021-02-10 09:51

    They are still used for exactly what you have mentioned. If an operation on one of the databases fails then it all gets rolled back.

    They are slower, and so if XA is not needed (i.e. it's an autonomous operation or non-transactional), then it should not be used.

    The Java EE container may even force you to use an XA datasource when dealing with multiple DBs.

提交回复
热议问题