java.sql.SQLException: Already in transaction

Discussions

XML & Web services: java.sql.SQLException: Already in transaction

  1. Hi All I am invoking a webservice deployed WLS 8.1 in Unix box and while it starts a transaction, I keep getting the below error. But the same works fine in my Development environment where code is deployed in WLS 8.1 on windows machine. Any pointers to causes of the below error would be really appreciated. Thanks and Regards, Gopal. 08AUG06 05:11:39 ERR:weblogiefault-14: java.sql.SQLException: Already in transaction. 08AUG06 05:11:39 ERR:weblogiefault-14: ErrorCode=-535 08AUG06 05:11:39 ERR:weblogiefault-14: SQLState=IX000 java.sql.SQLException: Already in transaction. at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:348) at com.informix.jdbc.IfxSqli.addException(IfxSqli.java:3025) at com.informix.jdbc.IfxSqli.receiveError(IfxSqli.java:3335) at com.informix.jdbc.IfxSqli.dispatchMsg(IfxSqli.java:2288) at com.informix.jdbc.IfxSqli.receiveMessage(IfxSqli.java:2208) at com.informix.jdbc.IfxSqli.sendStatementQuery(IfxSqli.java:1442) at com.informix.jdbc.IfxSqli.executeStatementQuery(IfxSqli.java:1381) at com.informix.jdbc.IfxSqli.executeStatementQuery(IfxSqli.java:1311) at com.informix.jdbc.IfxResultSet.executeQuery(IfxResultSet.java:229) at com.informix.jdbc.IfxStatement.executeQueryImpl(IfxStatement.java:817) at com.informix.jdbc.IfxPreparedStatement.executeQuery(IfxPreparedStatement.java:234) at com.informix.jdbc.IfxCallableStatement.executeQuery(IfxCallableStatement.java:167) at weblogic.jdbc.wrapper.PreparedStatement.executeQuery(PreparedStatement.java:124) at com.verizon.nsc.cmis.ticket.ejb.TicketManagerEJB.getNextRnid(TicketManagerEJB.java:1426) at com.verizon.nsc.cmis.ticket.ejb.TicketManagerEJB.saveTicket(TicketManagerEJB.java:580) at com.verizon.nsc.cmis.ticket.ejb.TicketManager_hi04mb_EOImpl.saveTicket(TicketManager_hi04mb_EOImpl.java:486) at com.verizon.nsc.cmis.ticket.ejb.TicketManager_hi04mb_EOImpl_WLSkel.invoke(Unknown Source) at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:166) at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:290) at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:248) at com.verizon.nsc.cmis.ticket.ejb.TicketManager_hi04mb_EOImpl_815_WLStub.saveTicket(Unknown Source) at com.verizon.nsc.bridge.ejb.facact.ProcessFACACT.processTicketFromFACACT(ProcessFACACT.java:108) at com.verizon.nsc.bridge.ejb.facact.FACACTUtilEJB.opCreate(FACACTUtilEJB.java:76) at com.verizon.nsc.bridge.ejb.facact.FACACTUtilEJB_qv88f4_EOImpl.opCreate(FACACTUtilEJB_qv88f4_EOImpl.java:46) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at weblogic.webservice.component.slsb.SLSBInvocationHandler.invoke(SLSBInvocationHandler.java:88) at weblogic.webservice.core.handler.InvokeHandler.handleRequest(InvokeHandler.java:104) at weblogic.webservice.core.HandlerChainImpl.handleRequest(HandlerChainImpl.java:143) at weblogic.webservice.core.DefaultOperation.process(DefaultOperation.java:549) at weblogic.webservice.server.Dispatcher.process(Dispatcher.java:204) at weblogic.webservice.server.Dispatcher.doDispatch(Dispatcher.java:176) at weblogic.webservice.server.Dispatcher.dispatch(Dispatcher.java:96) at weblogic.webservice.server.WebServiceManager.dispatch(WebServiceManager.java:100) at weblogic.webservice.server.servlet.WebServiceServlet.serverSideInvoke(WebServiceServlet.java:297) at weblogic.webservice.server.servlet.ServletBase.doPost(ServletBase.java:485) at weblogic.webservice.server.servlet.WebServiceServlet.doPost(WebServiceServlet.java:267) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1072) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:348) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6981) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121) at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3892) at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2766) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183) <Xid=BEA1-00098E77EF4D7BB213D5(13259109),Status=Rolled back. [Reason=Unknown],HeuristicErrorCode=XA_HEURHAZ,numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=0,seconds left=29,activeThread=Thread[ExecuteThread: '14' for queue: 'weblogic.kernel.Default',5,Thread Group for Queue: 'weblogic.kernel.Default'],XAServerResourceInfo[weblogic.jdbc.wrapper.JTSXAResourceImpl]=(ServerResourceInfo[weblogic.jdbc.wrapper.JTSXAResourceImpl]=(state=rolledback,assigned=cmis),xar=weblogic.jdbc.wrapper.JTSXAResourceImpl@a5d3d5,re-Registered = false),SCInfo[test_cmis+cmis]=(state=rolledback),properties=({weblogic.jdbc=t3://138.83.71.66:7751}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=cmis+138.83.71.66:7751+test_cmis+t3+, XAResources={JMS_FileStore, weblogic.jdbc.wrapper.JTSXAResourceImpl},NonXAResources={})],CoordinatorURL=cmis+138.83.71.66:7751+test_cmis+t3+) completed heuristically: (weblogic.jdbc.wrapper.JTSXAResourceImpl, HeuristicHazard, (javax.transaction.xa.XAException: Not in transaction.)) > 08AUG06 01:55:31 ERR:weblogiefault-14: java.rmi.RemoteException: EJB Exception:; nested exception is: java.rmi.RemoteException: java.sql.SQLException: Already in transaction.; nested exception is: java.sql.SQLException: Already in transaction. java.rmi.RemoteException: EJB Exception:; nested exception is: java.rmi.RemoteException: java.sql.SQLException: Already in transaction.; nested exception is: java.sql.SQLException: Already in transaction. at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:186) at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:290) at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:248) at com.verizon.nsc.cmis.ticket.ejb.TicketManager_hi04mb_EOImpl_815_WLStub.saveTicket(Unknown Source) at com.verizon.nsc.bridge.ejb.facact.ProcessFACACT.processTicketFromFACACT(ProcessFACACT.java:108) at com.verizon.nsc.bridge.ejb.facact.FACACTUtilEJB.opCreate(FACACTUtilEJB.java:76) at com.verizon.nsc.bridge.ejb.facact.FACACTUtilEJB_qv88f4_EOImpl.opCreate(FACACTUtilEJB_qv88f4_EOImpl.java:46) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at weblogic.webservice.component.slsb.SLSBInvocationHandler.invoke(SLSBInvocationHandler.java:88) at weblogic.webservice.core.handler.InvokeHandler.handleRequest(InvokeHandler.java:104) at weblogic.webservice.core.HandlerChainImpl.handleRequest(HandlerChainImpl.java:143) at weblogic.webservice.core.DefaultOperation.process(DefaultOperation.java:549) at weblogic.webservice.server.Dispatcher.process(Dispatcher.java:204) at weblogic.webservice.server.Dispatcher.doDispatch(Dispatcher.java:176) at weblogic.webservice.server.Dispatcher.dispatch(Dispatcher.java:96) at weblogic.webservice.server.WebServiceManager.dispatch(WebServiceManager.java:100) at weblogic.webservice.server.servlet.WebServiceServlet.serverSideInvoke(WebServiceServlet.java:297) at weblogic.webservice.server.servlet.ServletBase.doPost(ServletBase.java:485) at weblogic.webservice.server.servlet.WebServiceServlet.doPost(WebServiceServlet.java:267) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1072) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:348) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6981) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121) at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3892) at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2766) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183) Caused by: java.rmi.RemoteException: java.sql.SQLException: Already in transaction.; nested exception is: java.sql.SQLException: Already in transaction. at com.verizon.nsc.cmis.ticket.ejb.TicketManagerEJB.saveTicket(TicketManagerEJB.java:728) at com.verizon.nsc.cmis.ticket.ejb.TicketManager_hi04mb_EOImpl.saveTicket(TicketManager_hi04mb_EOImpl.java:486) at com.verizon.nsc.cmis.ticket.ejb.TicketManager_hi04mb_EOImpl_WLSkel.invoke(Unknown Source) at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:166) ... 33 more Caused by: java.sql.SQLException: Already in transaction. at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:348) at com.informix.jdbc.IfxSqli.addException(IfxSqli.java:3025) at com.informix.jdbc.IfxSqli.receiveError(IfxSqli.java:3335) at com.informix.jdbc.IfxSqli.dispatchMsg(IfxSqli.java:2288) at com.informix.jdbc.IfxSqli.receiveMessage(IfxSqli.java:2208) at com.informix.jdbc.IfxSqli.sendStatementQuery(IfxSqli.java:1442) at com.informix.jdbc.IfxSqli.executeStatementQuery(IfxSqli.java:1381) at com.informix.jdbc.IfxSqli.executeStatementQuery(IfxSqli.java:1311) at com.informix.jdbc.IfxResultSet.executeQuery(IfxResultSet.java:229) at com.informix.jdbc.IfxStatement.executeQueryImpl(IfxStatement.java:817) at com.informix.jdbc.IfxPreparedStatement.executeQuery(IfxPreparedStatement.java:234) at com.informix.jdbc.IfxCallableStatement.executeQuery(IfxCallableStatement.java:167) at weblogic.jdbc.wrapper.PreparedStatement.executeQuery(PreparedStatement.java:124) at com.verizon.nsc.cmis.ticket.ejb.TicketManagerEJB.getNextRnid(TicketManagerEJB.java:1426) at com.verizon.nsc.cmis.ticket.ejb.TicketManagerEJB.saveTicket(TicketManagerEJB.java:580)
  2. Strongly suggests that there is a configuration difference between your development and live environments. Somewhere there is a switch which turns transaction management on globally. You have this turned off in development and on in live. Assuming that is that the code is the same in both....
  3. Hi David, You were spot on.. In weblogic settings in our TEST environment, the creation of datasource in WLS was different from that in Dev. The difference was enabling "HONOR GLOBAL TRANSACTIONS" which was ON in the test box. Deleting that datasource and recreating it again with the above variable OFF, solved my issue... I printed the connection objects in the ON and OFF case and there was a difference. ON CASE - JTSConnection object was created. OFF CASE - PoolConnection object was created. I am not entirely sure of the difference anyway!! But the issue was solved :) Thanks for your time David. Thanks and Regards, Gopal.