SQL - Pseudo closed cursor

By kimot, 25 December, 2022

When the cursor is pseudo closed, the underlying file and ODP (Open data path) are left open. All record locks are released; however, a shared lock still appears on the file. DB2 for i can then reuse the cursor as needed without the overhead of a full open of the file. DB2 for i can also decide to hard close the pseudo closed cursor when needed.

You can force closing of the pseudo closed cursors of other jobs by specifying *RQSRLS for the Lock conflict action parameter of the ALCOBJ command :

ALCOBJ OBJ((QCUSTCDT *FILE *EXCL)) CONFLICT(*RQSRLS)

Do not forget to run DLCOBJ after job is done.