Atomikos Forum

Disable Rollback only feature of transaction

I have a transaction which is bounded by UserTransaction utx. On completing the DB update, i call utx.commit(). However, the commit fails with the following exception:
"javax.transaction.RollbackException: Transaction set to rollback only"

I am not setting transaction to rollback only anywhere in the code. This is picking up some default value which i want to disable as it is not letting me commit my updates.
How do i disable this?
Anirudh Rathi Send private email
Friday, March 23, 2012
 
 
This may be happen because somewhere an exception is thrown and its implicit set to rollback only.
Someone must set rollback only state - increasing log level should reveal the cause.
Torsten Krah Send private email
Friday, March 23, 2012
 
 
The exception is thrown while i try to call commit using utx.commit().

The stacktrace of the exception is:

[3/26/12 10:18:43:240 EDT] 00000022 SystemErr    R javax.transaction.RollbackException: Transaction set to rollback only
[3/26/12 10:18:43:240 EDT] 00000022 SystemErr    R     at com.atomikos.icatch.jta.TransactionImp.rethrowAsJtaRollbackException(TransactionImp.java:70)
[3/26/12 10:18:43:240 EDT] 00000022 SystemErr    R     at com.atomikos.icatch.jta.TransactionImp.commit(TransactionImp.java:250)
[3/26/12 10:18:43:240 EDT] 00000022 SystemErr    R     at com.atomikos.icatch.jta.TransactionManagerImp.commit(TransactionManagerImp.java:498)
[3/26/12 10:18:43:240 EDT] 00000022 SystemErr    R     at com.atomikos.icatch.jta.UserTransactionImp.commit(UserTransactionImp.java:129)
[3/26/12 10:18:43:240 EDT] 00000022 SystemErr    R     at com.Servlet.InitialServlet.doPost(InitialServlet.java:134)
[3/26/12 10:18:43:240 EDT] 00000022 SystemErr    R     at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
[3/26/12 10:18:43:240 EDT] 00000022 SystemErr    R     at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
[3/26/12 10:18:43:240 EDT] 00000022 SystemErr    R     at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1101)
[3/26/12 10:18:43:240 EDT] 00000022 SystemErr    R     at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:569)
[3/26/12 10:18:43:240 EDT] 00000022 SystemErr    R     at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
[3/26/12 10:18:43:240 EDT] 00000022 SystemErr    R     at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3440)
[3/26/12 10:18:43:240 EDT] 00000022 SystemErr    R     at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:267)
[3/26/12 10:18:43:240 EDT] 00000022 SystemErr    R     at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:815)
[3/26/12 10:18:43:240 EDT] 00000022 SystemErr    R     at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1461)
[3/26/12 10:18:43:240 EDT] 00000022 SystemErr    R     at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:118)
[3/26/12 10:18:43:240 EDT] 00000022 SystemErr    R     at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:458)
[3/26/12 10:18:43:240 EDT] 00000022 SystemErr    R     at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:387)
[3/26/12 10:18:43:240 EDT] 00000022 SystemErr    R     at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:267)
[3/26/12 10:18:43:240 EDT] 00000022 SystemErr    R     at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
[3/26/12 10:18:43:240 EDT] 00000022 SystemErr    R     at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
[3/26/12 10:18:43:240 EDT] 00000022 SystemErr    R     at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
[3/26/12 10:18:43:240 EDT] 00000022 SystemErr    R     at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
[3/26/12 10:18:43:240 EDT] 00000022 SystemErr    R     at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
[3/26/12 10:18:43:240 EDT] 00000022 SystemErr    R     at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
[3/26/12 10:18:43:240 EDT] 00000022 SystemErr    R     at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:195)
[3/26/12 10:18:43:240 EDT] 00000022 SystemErr    R     at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:743)
[3/26/12 10:18:43:240 EDT] 00000022 SystemErr    R     at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
[3/26/12 10:18:43:240 EDT] 00000022 SystemErr    R     at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1473)
[3/26/12 10:18:43:240 EDT] 00000022 SystemErr    R Caused by: com.atomikos.icatch.RollbackException: Transaction set to rollback only
    at com.atomikos.icatch.imp.TxRollbackOnlyStateHandler.commit(TxRollbackOnlyStateHandler.java:84)
    at com.atomikos.icatch.imp.CompositeTransactionImp.doCommit(CompositeTransactionImp.java:319)
    at com.atomikos.icatch.imp.CompositeTerminatorImp.commit(CompositeTerminatorImp.java:79)
    at com.atomikos.icatch.jta.TransactionImp.commit(TransactionImp.java:236)
    at com.atomikos.icatch.jta.TransactionManagerImp.commit(TransactionManagerImp.java:498)
    at com.atomikos.icatch.jta.UserTransactionImp.commit(UserTransactionImp.java:129)
    at com.Servlet.InitialServlet.doPost(InitialServlet.java:134)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1101)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:569)
    at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
    at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3440)
    at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:267)
    at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:815)
    at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1461)
    at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:118)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:458)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:387)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:267)
    at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
    at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
    at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
    at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
    at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
    at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
    at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:195)
    at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:743)
    at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1473)

[3/26/12 10:18:43:240 EDT] 00000022 SystemErr    R     at com.atomikos.icatch.imp.TxRollbackOnlyStateHandler.commit(TxRollbackOnlyStateHandler.java:84)
[3/26/12 10:18:43:240 EDT] 00000022 SystemErr    R     at com.atomikos.icatch.imp.CompositeTransactionImp.doCommit(CompositeTransactionImp.java:319)
[3/26/12 10:18:43:240 EDT] 00000022 SystemErr    R     at com.atomikos.icatch.imp.CompositeTerminatorImp.commit(CompositeTerminatorImp.java:79)
[3/26/12 10:18:43:240 EDT] 00000022 SystemErr    R     at com.atomikos.icatch.jta.TransactionImp.commit(TransactionImp.java:236)
[3/26/12 10:18:43:240 EDT] 00000022 SystemErr    R     ... 26 more
Anirudh Rathi Send private email
Monday, March 26, 2012
 
 
I do not see the any message about a transaction beeing opened. Please post (pastebin e.g. or somewhere else) the complete log (at least info level, debug is ok too), where we can see that a tx being opened, used and than comitted.
Torsten Krah Send private email
Tuesday, March 27, 2012
 
 
Was able to solve the issue.Here is what worked for me:

1.Open the Web Deployment Descriptor
2.Select the Servlet which initiates the transaction.
3.For the Servlet, seletec the Websphere Extensions > Local Transaction.
4.Set the Resolver as "ContainerAtBoundary" and Unresolved Action: Rollback.
5.Save and RePublish.
Anirudh Rathi Send private email
Tuesday, March 27, 2012
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics