JTA is useful not only for different database, but also for different connection to the same database.
Transaction manager manage Transaction by begin / suspend / getTransaction / setTransactionTimeout, its other methods just delegate to Transaction
Transaction then delegate call to each XAResource in list.
Can close connection before JTA transaction commit? Yes, TransactionManager will call XAResource.end() method to disassociate the transaction from that connection (but sqls sent by this connection will still in effect), and the connection may (or may not) return to connection pool.
本文探讨了 Java 事务 API (JTA) 在不同数据库及同一数据库的不同连接间的应用。详细介绍了事务管理器如何通过 begin、suspend 和 getTransaction 等方法管理事务,并通过调用 XA 资源来实现事务的委托处理。此外,还讨论了在 JTA 事务提交前关闭连接的影响。
1575

被折叠的 条评论
为什么被折叠?



