开发者

Does Spring JtaTransactionManager automatically omit non-used resources per transactions from Two-Phase Commit?

开发者 https://www.devze.com 2023-02-14 01:18 出处:网络
I\'m wondering how Spring enlists resources for a given annotated transaction. Say I have 3 XA enabled datasources D1, D2 and D3. At some times transactions might occur between D1 and D2, at other tim

I'm wondering how Spring enlists resources for a given annotated transaction. Say I have 3 XA enabled datasources D1, D2 and D3. At some times transactions might occur between D1 and D2, at other times, it might occur between D2 and D3, sometimes all datasources (and all combinations...etc.).

So, will Spring automatically enlist only the required resources for a given transaction if all three datasources have been attached to a single JtaTransactionManager instance? If not, must I create multiple instances of JtaTransactionManager per combination of resource enlistment?

Thanks,

Chris

P.S. I have a non-Spring follow up question t开发者_开发知识库o this but I'll post separately.


As far as I know, Spring does not care about the XA but is just handling the XA TX manager as a generic JTA manager. So its up to the manager to do it's work when getting committed / rolled back. Spring does just ensure the call is done. That's done by the same proxy implementation that is used by any other Spring TA proxy.

0

精彩评论

暂无评论...
验证码 换一张
取 消