• No replies
7 Posts

Pinned topic WS-Transaction rollback not working

‏2013-04-29T18:32:50Z |

I am developing a jax-ws web service proof of concept in RAD 8.0.4 and running in WebSphere 7. Our app uses Spring and Hibernate, but we're not exactly experts in either. We need to enable global transactions with our web service so it can work with the transactions of client apps. I followed the instructions I found on various websites, including IBMs, and I thought I configured everything and it doesn't work.  Clearly I did something wrong.

Each transaction (client and service) work fine independently, but I forced an exception before commit in my client. This rolls back the client transaction, but not the service transaction. Furthermore, the logging on websphere (not the simply systemout one...the trace from the admin console) spits out some gobbledy-gook that implies to me that no transaction context was offered from the client.

I initially set the policies in both the services view of RAD and the admin console, but I've since read that if you set both, it doesn't work. But I have since tried just one and just the other and neither work. Here's what i did:

In my wsdl I manually added:

<wsp:Policy wsu:Id="ATPolicy">   
      <!-- omitted assertions -->   

and the wsp:PolicyReference line

<binding name="TxPortBinding" type="tns:TxDelegate">   
<soap:binding style="document" transport=""/>   
<operation name="insertDBTrans">   
 <wsp:PolicyReference URI="#ATPolicy" required="true"/>         
  <soap:operation soapAction=""/>   
    <soap:body use="literal"/>   
    <soap:body use="literal"/>   

In the admin console version, after importing the WS-Transaction policy, I navigated to Services->Service Providers->TxService, and selected the checkbox of all three level, TxService, TxPort, and insertDBTrans. Chose Attach Policy Set->WSTransaction. Click the disabled link on the service, and chose 'exported WSDL'. Ok & Save.

Then to Services->Service Clients->TxService. Check client, Attach Client Policy Set->WSTransaction. Client and provier policy chosen.

But that didn't work. So I remove them, and instead go into the services view of RAD. Right clicked on the service, manage policy sets. Put WSTransaction on the first page with Provider Sample as binding attached. It's set all the way down to the operation name - insertDbTrans.

Under the client in the services view I set the client to user provider policy, second page, chose WSTransaction for the default entry and it set to "client and provider".

We use Transactional annotations to manage our transactions via spring. The transaction manager is defined thusly: <tx:jta-transaction-manager id="transactionManager"> <property name="userTransactionName" value="java:comp/UserTransaction" /> </tx:jta-transaction-manager>

I actually tried more permutations than this. But none of them has worked.

Any ideas what I am doing wrong here?