1 Reply Latest reply on Mar 22, 2002 9:40 AM by annegret

    Executing a query fails

    roelli06

      Hello all,

      I have trouble with executing PreparedStatements. Some select statements fail with the exception shown below.
      It does no matter if the statements were executed from a session or a entity bean. Inserts and updates are working properly.
      I could not find any reason why this exception comes up.
      Any suggestions?

      I'm using JBoss 2.4.3 with Tomcat 3.2.3 and Oracle 9i.



      Thats what the code looks like:

      ps is declared as PreparedStatment, result is declared as ResultSet and dbConn is declared as Connection

      public void ejbLoad() {
      AccountPK primaryKey = (AccountPK)context.getPrimaryKey();
      ps = null;
      result = null;

      try {
      ps = dbConn.prepareStatement(
      "SELECT ACC_NR, " +
      " ACCOUNT, " +
      " KUNDE, " +
      " INFO " +
      " FROM TS_ACCOUNTS " +
      " WHERE ACC_ID = ?");
      ps.setInt(1, primaryKey.id);
      result = ps.executeQuery();
      if (result.next()) {
      id = primaryKey.id;
      accnr = result.getInt(1);
      account = result.getString("account");
      kunde = result.getString("kunde");
      info = result.getString("info");
      }
      else {
      throw new EJBException();
      }
      } catch (SQLException se) {throw new EJBException(se);}
      finally {
      try {
      if (result != null) result.close();
      if (ps != null) ps.close();
      } catch (SQLException se) {se.printStackTrace();}
      }
      }



      [Account] TRANSACTION ROLLBACK EXCEPTION:null
      Embedded Exception
      ORA-00600: Interner Fehlercode, Argumente: [ttcgcshnd-1], [0], [], [], [], [], [], []
      ; nested exception is:
      javax.ejb.EJBException: null
      Embedded Exception
      ORA-00600: Interner Fehlercode, Argumente: [ttcgcshnd-1], [0], [], [], [], [], [], []

      [Account] java.sql.SQLException: ORA-00600: Interner Fehlercode, Argumente: [ttcgcshnd-1], [0], [], [], [], [], [], []
      [Account]
      [Account] at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
      [Account] at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
      [Account] at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543)
      [Account] at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1405)
      [Account] at oracle.jdbc.ttc7.TTC7Protocol.fetch(TTC7Protocol.java:889)
      [Account] at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:1681)
      [Account] at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1870)
      [Account] at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:363)
      [Account] at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:314)
      [Account] at timesheet.impl.AccountBean.ejbLoad(AccountBean.java:140)
      [Account] at java.lang.reflect.Method.invoke(Native Method)
      [Account] at org.jboss.ejb.plugins.BMPPersistenceManager.loadEntity(BMPPersistenceManager.java:315)
      [Account] at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySynchronizationInterceptor.java:286)
      [Account] at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:208)
      [Account] at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:136)
      [Account] at org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:133)
      [Account] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:307)
      [Account] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:99)
      [Account] at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:128)
      [Account] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:195)
      [Account] at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:427)
      [Account] at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContainerInvoker.java:395)
      [Account] at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContainerInvoker.java:476)
      [Account] at org.jboss.ejb.plugins.jrmp.interfaces.GenericProxy.invokeContainer(GenericProxy.java:335)
      [Account] at org.jboss.ejb.plugins.jrmp.interfaces.EntityProxy.invoke(EntityProxy.java:133)
      [Account] at $Proxy13.getKunde(Unknown Source)
      [Account] at Timesheet._0002fTimesheet_0002fAccount_0002ejspAccount_jsp_31._jspService(_0002fTimesheet_0002fAccount_0002ejspAccount_jsp_31.java:161)
      [Account] at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
      [Account] at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      [Account] at org.apache.jasper.servlet.JspServlet$JspCountedServlet.service(JspServlet.java:130)
      [Account] at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      [Account] at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:282)
      [Account] at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:429)
      [Account] at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:500)
      [Account] at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      [Account] at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
      [Account] at org.apache.tomcat.core.Handler.service(Handler.java:287)
      [Account] at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
      [Account] at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:812)
      [Account] at org.apache.tomcat.core.ContextManager.service(ContextManager.java:758)
      [Account] at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
      [Account] at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
      [Account] at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
      [Account] at java.lang.Thread.run(Unknown Source)
      [EmbeddedTomcatServiceSX] 2002-03-21 16:12:25 - Ctx( /applied ): IOException in: R( /applied + /Timesheet/Account.jsp + null) null
      Embedded Exception
      ORA-00600: Interner Fehlercode, Argumente: [ttcgcshnd-1], [0], [], [], [], [], [], []
      ; nested exception is:
      javax.ejb.EJBException: null
      Embedded Exception
      ORA-00600: Interner Fehlercode, Argumente: [ttcgcshnd-1], [0], [], [], [], [], [], []


      Thanks ...

        • 1. Re: Executing a query fails
          annegret

          Sorry, I don't know what causes the error, the sql-statement looks correct.

          Probably You can find more info if You look for the errorcode ORA-00600 in the help of Your database.

          I don't have experience with Oracle, but on MSAccess and Sybase I found some similar errors when I tried to execute the SQLstatement directly on the database because I got more detailed errormessages.

          Hope this helps ;-)