This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Web Services and the fly likes Global Transactions, Spring, WebSphere, JAX-WS and Hibernate - transaction not rolling back Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Global Transactions, Spring, WebSphere, JAX-WS and Hibernate - transaction not rolling back" Watch "Global Transactions, Spring, WebSphere, JAX-WS and Hibernate - transaction not rolling back" New topic
Author

Global Transactions, Spring, WebSphere, JAX-WS and Hibernate - transaction not rolling back

Brian Mulholland
Ranch Hand

Joined: Mar 12, 2009
Posts: 61
I am attempting to write a demo of a JAX-WS service participating in a global transaction. This is a model my organization will be doing more of as time goes on and we need to figure it out, but I am struggling.

I have a WSDL service being invoked from a client (which is also in a Java EE servlet with the same config...in fact it is the same server, but I can see that it is calling out over the wire to itself). Both are updating their rows, and then I throw an exception but the service will not rollback.

I have annotated a method that invokes both a local DAO update and the WSDL service client with @Transactional(propagation=Propagation.REQUIRED). That service in turn invokes another method, also anotated in the same way, which in turn calls a dao method to do another db update.

app-config.xml:


I have followed some tutorials that had me go in to the Services view and add the WSTRansaction policy sets and bindings o the client and service (both generated initially from the RAD wizard), and then again into Admin Console applications->application Types->Websphere enterprise apps->my app->Service provider/client policy sets and bindings. There I added WSTransaction to client and service respectively at the parent application level (the policy inherits down to the endpoint).

But at the end of the day, no rollback is happening. Help! What am I missing? What have I misconfigured?
Brian Mulholland
Ranch Hand

Joined: Mar 12, 2009
Posts: 61
I found how to turn on the websphere transaction trace log in the admin console. It says (edited for brevity):

No transaction context found
Exit
Entry parm0=Operation: isAlive
No transaction context from incoming request
getTransactionManager parm0=com.ibm.ws.tx.jta.TranManagerSet@306e306e

These messages come with a bunch of what appear to be inspections of objects, and they repeat many times. Okay, so I appear to not be sending a transaction context from my client. But I still don't understand why. Anyone?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Global Transactions, Spring, WebSphere, JAX-WS and Hibernate - transaction not rolling back
 
Similar Threads
Spring And Hibernate (LocalSessionFactoryBean)
Dependency injection problem
How to access application-context beans in dispatcher-servlet.xml
Spring Configuration file using Data Source for JUnit Test Cases...........
Spring-Hibernate transaction management