Forums Register Login

SetAutoCommit ->flag , Servlet, DAO object, Websphere

+Pie Number of slices to send: Send
I have come across this issue and I observe the following. I would appreciate feedback on this.
Thanks.

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)
This tiny ad is suggesting that maybe she should go play in traffic.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 2304 times.
Similar Threads
E WTRN0043I: LocalTransaction rolled-back due to setRollbackOnly.
migration - transaction - session lost
can anybody help... urgent
JTA, JDBC, Websphere 5.0.2
Error Accessing the database
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 11:53:43.