Our architecture comprises of Web Services developed on JAX-WS specification using
Metro. These services are deployed on a single Glass Fish App server as separate war
files.All web services internally use a si开发者_运维技巧ngle database.The datatacess layer is implemented using Hibernate and Spring is used for implementing transactions inside of the service. Now when we want to do a transaction that spans across multiple web services,what approaches are possible?
- Do we need to use JTA or can we avoid the same ?
- Will we need to use the WS-AtomicTransaction specification supported by Metro?
I am answering my own question because no answers till now. However will appreciate views on the same. I feel the best architecture would be treat each web service as separate and use WS-AtomicTransactions/WS-Coodrination for transaction across web services. This will also help when some web services need to be deployed into different glassfish domains or onto different servers alltogether for performance or some other reasons. Internally these JAX-WS Metro services will use the JTA on glassfish to implement a 2PC. However thats hidden inside Metro Implementation
Vipul Shah
精彩评论