File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes SetAutoCommit ->flag ,  Servlet, DAO object, Websphere Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "SetAutoCommit ->flag ,  Servlet, DAO object, Websphere " Watch "SetAutoCommit ->flag ,  Servlet, DAO object, Websphere " New topic
Author

SetAutoCommit ->flag , Servlet, DAO object, Websphere

prasad nathan
Greenhorn

Joined: Apr 27, 2004
Posts: 1
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)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SetAutoCommit ->flag , Servlet, DAO object, Websphere
 
Similar Threads
JTA, JDBC, Websphere 5.0.2
Error Accessing the database
can anybody help... urgent
E WTRN0043I: LocalTransaction rolled-back due to setRollbackOnly.
migration - transaction - session lost