WS-AtomicTransaction with Axis2
I have been using Axis2 to genarate my web services. Some of my services are a part of transaction - i.e, either all or none of them have to be executed.
开发者_JAVA技巧To solve my problem, I have been reading about the WS-AT specs over the web. But I am unable to figure out how to configure and use this feature with Axis2. Can anyone please share how to start off ? Any supporting code will be good.
Thanks!
You may do better to use a JAX/WS implementation provided by a particular application server vendor. You can see tutorials such as this.
One thing to be aware of is that distributed transactions may seem very attractive but they do add considerable operational complexity, especially in failure scenarios.
- The Transaction manager's transaction logs become critical to managing consistency between systems. Lose those logs and you have the potential to lose knowledge of the outcome of a transaction.
- You introduce coupling between systems that may have different availability characteristics. A system failure at just the right (or rather wrong) time will cause database locks to be held in one system until all systems are restored to service. To be specific, in the two-phase protocol, after a resource (eg. Database) has "voted" in phase 1, it cannot resolve the transaction until the transaction manager decides the overall fate of the transaction by collecting votes from all participants. If one participant cannot be restored for a time then all locks held by that transaction are kept for that time. The only workaround is manual intervention (operational complexity) and potential inconsistency.
In summary, I would be reluctant to recommend the use of distributed transactions between systems that are in different operational domains (eg. different companies, or different geographies).
精彩评论