• Post Reply Bookmark Topic Watch Topic
  • New Topic

SetAutoCommit ->flag , Servlet, DAO object, Websphere

prasad nathan
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have come across this issue and I observe the following. I would appreciate feedback on this.

On Websphere 5.2.2 , 'connection.setAutoCommit' Flag need to be set to 'true' if we are using 'Servlet' making call to
the DAO object, which performs read only 'select' queries.If this flag is is set to 'false', the following message shows up.
Note:If we are using Stateless session with trasaction attribute set to 'Container' managed on the ejbjar.xml [<transaction-type>Container</transaction-type>], 'connection.setAutoCommit' flag can be
set to 'false'. EJB containere take care of the peroforming 'commits' for the transactions. If we perform 'select' query with the flag set to 'false' does not throw any exception.

Browser Message:
Error 500: LocalTransaction rolled-back due to setRollbackOnly.
I observe this message on the browser. I could not capture this on the
servlet, even if I wrap the code with try , catch and catch the 'java.lang.throwable' exception.

Appserver log:
[4/27/04 9:45:04:821 EDT] 34eba2a5 LocalTransact E WLTC0033E: Resource jdbc/PostalOneDB rolled back in cleanup of unresolved LocalTransactionContainment.
[4/27/04 9:45:04:821 EDT] 34eba2a5 LocalTransact E WLTC0032E: One or more resources rolled back. An unresolved LocalTransactionContainment had an unresolved action of rollback.
[4/27/04 9:45:04:821 EDT] 34eba2a5 WebAppTransac E SRVE0183E: LocalTransaction rolled-back due to setRollbackOnly
[4/27/04 9:45:04:837 EDT] 34eba2a5 WebGroup E SRVE0026E: [Servlet Error]-[LocalTransaction rolled-back due to setRollbackOnly]: com.ibm.ws.LocalTransaction.RolledbackException
at com.ibm.ws.LocalTransaction.LocalTranCoordImpl.cleanup(LocalTranCoordImpl.java:967)
at com.ibm.ws.webcontainer.webapp.WebAppTransactionCollaborator.postInvoke(WebAppTransactionCollaborator.java:208)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:673)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:176)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:79)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:201)
at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:182)
at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:610)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:431)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:593)
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!