Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

debugging intermittent "no data found" error

temApr 10 2013 — edited Apr 15 2013
I'm running into an INTERMITTENT error using Java 1.6 connecting to Oracle database 11.2 using GlassFish 3.2 JDBC pool, all on CentOS servers (java app server is separate from database server).

I get the following error from the java program intermittently:

Apr 10, 2013 8:35:44 AM com.mycompany.MyClass MySPROC
SEVERE:
stack trace: java.sql.SQLException: ORA-01403: no data found
ORA-06512: at "MYSCHEMA.MY_PACKAGE", line 144
ORA-06512: at line 1

This example shows line 144 of a certain package, but the same error can occur in other packages or stored procedures on different SQL select commands.

Nevertheless, if I run that line 144 of code in Oracle database using SQL Developer, it returns data fine. Also, if I re-run the client program to repeat the same execution of the java code, there is no problem retrieving the data. However, at some time in the future, the same program attempts to retrieve the same data and the error appears with some small probability.

The most logical problem would be if the database table didn't have any data for line 144 sql query. But, since it's intermittent, and the database table doesn't change, and the java program variables accessing the database stored procedure do not change (I'm in a development environment and all the data is controlled, so I know there's no changes entering the java program from the client, which calls the oracle package or sproc), I "think" we can eliminate this as the suspect.

So, I'm not sure what other scenarios can lead to this error. Any ideas?

My Java POJO has the following structure, and I wonder if it's possible to modify it to see more of the stack trace coming from Oracle...

public String MyJavaPOJO(...) throws Exception {

try {
...
} catch (Exception e) {
loggerWrapper.myLogger.log(Level.SEVERE, "\nstack trace: "+e.fillInStackTrace());
} finally {
closeDatabase(var1, cs, rset, conn);
}
return myOutputVariable;
}

I searched the alert log file but there were no entries when this error occurred. Also, I checked the GlassFish server.log file and nothing was there either.

I posted this originally in an OTN Java forum, but they referred me elsewhere.

Any advice much appreciated.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 13 2013
Added on Apr 10 2013
5 comments
914 views