Neoview Guide to Stored Procedures in Java (R2.5)

8 Performance and Troubleshooting
This chapter describes how to improve and monitor the performance of SPJs on the Neoview
platform and provides guidelines for troubleshooting common problems:
“Troubleshooting Common Problems”
“Performance Tip”
“Displaying an Execution Plan of a CALL Statement” (page 62)
Troubleshooting Common Problems
To resolve problems that occur when you register or execute an SPJ, follow these guidelines:
Note the SQLCODE or SQLSTATE value of the error messages and locate the information
in the Neoview Messages Manual, which provides cause, effect, and recovery information for
all SQL errors.
Check that the user role has the appropriate permissions to create or call the SPJ. See these
sections:
“Required Privileges for Creating or Dropping an SPJ” (page 37)
“Required Privileges for Calling an SPJ” (page 51)
Check the code of the SPJ method. See Chapter 3 (page 23). Fix any problems.
If you successfully compiled, deployed, and registered the SPJ but are receiving errors when
calling the SPJ, check that the output parameters in the Java method are specified as arrays.
See “Returning Output Values From the Java Method” (page 24).
Verify that the SPJ method and its JAR file exist on the Neoview platform and that someone
did not delete or change the SPJ bytecode without first dropping the SPJ from the Neoview
database. See Altering an SPJ and Its Java Bytecode” (page 44).
Check the characteristics of the stored procedure in HPDM and compare them with the SPJ
method that resides on the Neoview platform. Fix any discrepancies.
Check the syntax of the CALL statement in the application. See Chapter 7 (page 51). Fix any
problems.
If the SPJ is supposed to return result sets, but the result sets are not being returned to the
calling application, check that the SPJ method does not explicitly close a
java.sql.Connection object. See “Use of java.sql.Connection Objects” (page 28).
If a java.lang.ArrayIndexOutOfBoundsException occurs, check that the SPJ method
is not trying to insert more than one array element into a java.sql.ResultSets[] array.
For more information, see “Returning Stored Procedure Result Sets” (page 25).
To identify Java-related errors, execute the SPJ method outside the Neoview database by
invoking the Java method directly in a Java application that you run on a client workstation,
using the Neoview JDBC Type 4 driver to connect to the Neoview platform.
If you are using JDBC tracing and logging, follow these guidelines:
Execute the SPJ method outside the Neoview database by invoking the Java method
directly in a Java application that you run on a client workstation, using the Neoview
JDBC Type 4 driver to connect to the Neoview platform.
Verify that the file directory specified in the T4LogFile property exists on the client
workstation and that you have write access to it.
For more information about JDBC tracing and logging, see the Neoview JDBC Type 4 Driver
Programmer's Reference.
If you are super.services, see the “Stored Procedures in Java Support Information” chapter in
the Neoview Database Support Guide for additional troubleshooting information.
Troubleshooting Common Problems 61