Skip to main content

Problem:

COBOL/Java/Oracle 9i application has failed with SQL abend code 1455 whenever COBOL with Oracle FETCH is executed multiple times from JAVA.

Application logic that requires CONNECT function is based on a variable in Working-Storage that is set initially to "Y" and then reset to "N" after the CONNECT.

During subsequent executions of the COBOL and Oracle program, the Working-Storage field is left as 'N" and it is unclear why.  It is supposed to be a completed process after each run.

Eliminating the JAVA interface permits the application to execute any number of times.  So the inital value of the Working-Storage field is reinitialized each time the program runs outside the JAVA interface.

Problem is two-fold:  what is causing the SQL abend code and why isn't the JAVA interface clearing the process each time it completes?

Resolution:

SQL error 1455 was accurate.  

The reason was there had been two CONNECTs to same data base.

So when SQL FETCH was requested, the Oracle engine failed to run.

Recoding the application to ensure a single CONNECT was performed resolved the SQL error.

To resolve the JAVA interface problem an additional routine was added to the COBOL program.

cobthreadtidy() - Causes the COBOL thread associated with the currently running Java thread to be cleanly finalized.  

For example, insert this syntax in your C program after the COBOL returns:

#include "cobmain.h"

int cobthreadtidy(void);

For more information about Java and COBOL programming refer to the on-line documentation, Reference manual, "C Functions for Calling COBOL".

Old KB# 2149