The SET CURSOR_CLOSE_ON_COMMIT statement sets all cursors on a connection to automatically close when a COMMIT TRANSACTION or a ROLLBACK TRANSACTION statement is issued.
SET CURSOR_CLOSE_ON_COMMIT { ON | OFF };
ON
Specifies closing all cursors on a connection when a COMMIT TRANSACTION or a ROLLBACK TRANSACTION statement is issued.
OFF (default)
Specifies that the calling application is required to close each cursor on a connection when a COMMIT TRANSACTION or a ROLLBACK TRANSACTION statement is issued.
You can use the SET CURSOR_CLOSE_ON_COMMIT command for standard and browse cursors.