-500   THE IDENTIFIED CURSOR WAS CLOSED WHEN THE CONNECTION WAS DESTROYED

Explanation

The FETCH, UPDATE, DELETE, or CLOSE statement identifies a closed cursor that was defined with the WITH HOLD option. The cursor was closed when the connection on which it was dependent was destroyed during a commit operation. The connection was destroyed because the application process placed it in the released state, or the application plan was bound with the DISCONNECT(AUTOMATIC) option.

System action

The statement cannot be processed.

Programmer response

Take one of the following actions:
  • If you want the cursor closed, change the application program so that the cursor is not referenced in the closed state.
  • If you want the cursor open and the connection was placed in the released state by the application program, change the program so that the connection is not placed in the released state until the cursor is explicitly closed.
  • If you want the cursor open and the connection was placed in the released state as a result of the DISCONNECT(AUTOMATIC) option, rebind the plan using DISCONNECT(CONDITIONAL).

Correct the error in the application, rebind the plan, and resubmit the job.

SQLSTATE

24501