-
1. Re: wst vs. wstx
kadlecp Feb 4, 2008 10:27 AM (in response to kadlecp)For my purposes it would be enough if web service transaction participant would call rollback instead of rollbackOnly. But I am not sure if it is correct solution from the specification point of view...
I just want to solve the case when web service transaction participant knows that the transaction should be rolled back. -
2. Re: wst vs. wstx
adinn Feb 4, 2008 10:50 AM (in response to kadlecp)The two UserTransaction classes you mention are not the same.
The wstx UserTransaction provides an API which supports nested transactions i.e. if you call begin while a transaction is active it will enter a subtransaction and the next commit or abort will be performed relative to the enclosing transaction but will not be visible to other transactions until the outermost tx is committed. This will not be appropriate unless the resources participating in your transaction support nested transactions.
The wst UserTransaction will reject any attempt to begin a transaction from within an existing transaction throwing an illegal state exception. This the expected behaviour for transactions conforming to the JTA model.
If you want to roll back the transaction what is wrong with calling userTransaction.rollback()? -
3. Re: wst vs. wstx
marklittle Feb 4, 2008 11:32 AM (in response to kadlecp)Use the one mentioned in the documentation.
-
4. Re: wst vs. wstx
kadlecp Feb 5, 2008 6:47 AM (in response to kadlecp)Thank you very much for answers,
I do not need nested transactions, so I will use "wst transactions".If you want to roll back the transaction what is wrong with calling userTransaction.rollback()?
Maybe nothing. I have similar model using JTA transactions, not WS-Transactions. And if JTA participant knows that JTA transaction should be rolled back, the participant marks the transaction to rollbackOnly. My special aggregator aggregating responses from participants then calls rollback. I like the idea that participant don't call rollback, but only marks tx to rollbackOnly. The commit, rollback is job of somebody else, the aggregator.
So conclusion, my ws participant will call userTransaction.rollback() when some business error arises...
Pavel