0 Replies Latest reply on Feb 17, 2003 12:01 PM by geetesh

    ResourceException while closing connection handle!

    geetesh Newbie

      I am using JBoss3.0.4/tomcat4.1.12, PostgreSQL

      I Passed String with null character in my PreparedStatement using setString()
      i got SQLException - ERROR - "Unterminated String Constant". This is fine
      but then JBoss was unable to close Connection ( I had connection close in finally block) And then all the connection exhausted from pool


      my code is-
      try
      {
      con = getConnection();
      stat = con.prepareStatement("Select * from users where user_login = ?");
      String th = "test\0in\0g";
      stat.setString(1, th);
      rs = stat.executeQuery();
      }
      catch(SQLException e){e.printStackTrace();
      }catch(Exception ex){}
      finally
      {
      try{
      if(rs != null) rs.close();
      if(stat != null) stat.close();
      if(con!=null)con.close();
      }catch(Exception e){e.printStackTrace();}
      }

      i got the following exception

      19:48:22,091 ERROR [LocalTxConnectionManager$LocalConnectionEventListener] ResourceException while closing connection handle!
      javax.resource.ResourceException: Could not cleanup: java.sql.SQLException: FATAL 1: Socket command type s unknown

      at org.jboss.resource.adapter.jdbc.local.LocalManagedConnection.cleanup(LocalManagedConnection.java:198)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.unregisterAssociation(BaseConnectionManager2.java:666)
      at org.jboss.resource.connectionmanager.LocalTxConnectionManager$LocalConnectionEventListener.connectionClosed(LocalTxConnectionManager.java:384)
      at org.jboss.resource.adapter.jdbc.local.LocalManagedConnection.closeHandle(LocalManagedConnection.java:339)
      at org.jboss.resource.adapter.jdbc.local.LocalConnection.close(LocalConnection.java:97)
      at com.test.servlets.TestServlet.executePreparedStatement(TestServlet.java:134)
      at com.test.servlets.TestServlet.handleRequest(TestServlet.java:149)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:471)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2396)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:469)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.ajp.tomcat4.Ajp13Processor.process(Ajp13Processor.java:458)
      at org.apache.ajp.tomcat4.Ajp13Processor.run(Ajp13Processor.java:551)
      at java.lang.Thread.run(Thread.java:484)


      19:48:22,096 ERROR [STDERR] java.sql.SQLException: ERROR: Unterminated quoted string
      19:48:22,097 ERROR [STDERR] at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:94)
      19:48:22,098 ERROR [STDERR] at org.postgresql.Connection.ExecSQL(Connection.java:398)
      19:48:22,098 ERROR [STDERR] at org.postgresql.jdbc2.Statement.execute(Statement.java:130)
      19:48:22,099 ERROR [STDERR] at org.postgresql.jdbc2.Statement.executeQuery(Statement.java:54)
      19:48:22,099 ERROR [STDERR] at org.postgresql.jdbc2.PreparedStatement.executeQuery(PreparedStatement.java:99)
      19:48:22,100 ERROR [STDERR] at org.jboss.resource.adapter.jdbc.local.LocalPreparedStatement.executeQuery(LocalPreparedStatement.java:289)
      19:48:22,101 ERROR [STDERR] at com.test.servlets.TestServlet.executePreparedStatement(TestServlet.java:123)
      19:48:22,102 ERROR [STDERR] at com.test.servlets.TestServlet.handleRequest(TestServlet.java:149)
      19:48:22,103 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      19:48:22,104 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
      19:48:22,104 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
      19:48:22,105 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
      19:48:22,105 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      19:48:22,106 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      19:48:22,106 ERROR [STDERR] at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      19:48:22,107 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      19:48:22,107 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      19:48:22,108 ERROR [STDERR] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:471)
      19:48:22,108 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      19:48:22,109 ERROR [STDERR] at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
      19:48:22,109 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      19:48:22,110 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      19:48:22,110 ERROR [STDERR] at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      19:48:22,111 ERROR [STDERR] at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2396)
      19:48:22,111 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
      19:48:22,112 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      19:48:22,112 ERROR [STDERR] at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
      19:48:22,113 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      19:48:22,113 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
      19:48:22,114 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      19:48:22,115 ERROR [STDERR] at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:469)
      19:48:22,115 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      19:48:22,116 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      19:48:22,116 ERROR [STDERR] at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      19:48:22,117 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
      19:48:22,117 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      19:48:22,118 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      19:48:22,118 ERROR [STDERR] at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      19:48:22,119 ERROR [STDERR] at org.apache.ajp.tomcat4.Ajp13Processor.process(Ajp13Processor.java:458)
      19:48:22,119 ERROR [STDERR] at org.apache.ajp.tomcat4.Ajp13Processor.run(Ajp13Processor.java:551)
      19:48:22,120 ERROR [STDERR] at java.lang.Thread.run(Thread.java:484)



      does anyone had this problem??