After having successfully integrated JBossTS JTA into our web application, we're now planning to go further and make the web services of our application to be transactional.
I read with care all the documentation of XTS and the transaction bridge and I find the topic very very interesting!
However, I have a little doubt of one aspect I couldn't fully understand from the documentation.
Suppose I have the following scenario: my web application exposes a web service called MyService, a very simple one that, once called, just starts a JTA transaction, writes something to a database and commits the transaction. At first, suppose this web service is not a transactional one, so the typical workflow is that a web service client invokes it outside of any transactional context just to do a persistent modification to the application database. Saying in other words, it's like MyService were working in "auto-commit" mode, or, using the terminology of Mark Richards at http://www.ibm.com/developerworks/java/library/j-ts2.html, that the transaction strategy were managed at the API layer (where API here is the web service).
Now, suppose I want to switch to a client orchestrated transaction strategy, by making this web service transactional. Suppose I set up the whole XTS thing on both the client side and the server side (so that the appropriate handlers for both WS-AT and the bridge are configured, the coordination service is running, etc.) and that I change the client so that it:
- starts a WS-AT transaction
- invokes my simple web service in that transaction context
- then commits the WS-AT transaction
My question is: do I have to change the code of MyService?
My concern is about the fact that MyService actually commits the JTA transaction after having started it (and after having made some changes in the DB). I understood the interposition and the parent-subordinate coordinator mechanism, but it's not clear to me if the fact that I issue a commit in a JTA transaction which is actually a subordinate transaction of a WS-AT parent one, automatically translates in the system to actually post-pone the "real" commit only when the "commit" command is issued on the parent WS-AT transaction.
If it is so, it's really great, because the changes needed to make our web services transactional is almost null.
If not, how do I have to change the code of MyService to accomplish the result?
Thanks in advance,