Question

I have multiple oracle connection so i have to fire the transactions on all the datasources at once and if one fails, it gets rolled back on all or committed on all of them together. How to achieve this with XADatasource ?

Was it helpful?

Solution

An XADataSource API provides two-phase commit to achieve this in a distributed environment. You need to make your DataSource Wrapper class using this API and the rest would be taken care by the API itself.

XA is best used with and app server like JBoss or WebSphere etc. But you can configure it in non-managed environments too.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top