Executing a query fails
roelli06 Mar 22, 2002 9:24 AMHello 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 ...