SG-1141 CLONE - Base - Cursor leak in O7FLXPKG |
Description |
|
There is a cursor-leak in procedure 07flxexec when a PL/SQL flextriggers exits with a -20003 user defined exception. The (dynamic) cursor \\"r5flexsql_cursor\\" is not closed. *Steps to reproduce:* # define a PL/SQL flextrigger on a table to trigger a -20003 application error # create a loop to insert op update data # check the open cursors *Expected result:* Cursor is closed *Actual result:* the EXIT statement breaks out of the FOR-LOOP- so the close_cursor that follows is NOT executed when the ORA-20003 occurs. END IF; WHEN OTHERS THEN r5flexsql_rec.flx_msgfailure := SUBSTR(SQLERRM,11,255); IF SQLERRM LIKE 'ORA-20003%' THEN cmessage := r5flexsql_rec.flx_msgfailure; nstatus := 2; CLOSE r5flexsql_cur; EXIT; END IF; END; END IF; /* IF itisselect THEN if dbms_sql.is_open(r5flexsql_cursor) THEN omessage := 'Before fetch select open'; ELSE omessage := 'Before Fetching select'; END IF; rowsprocessed:=dbms_sql.fetch_rows(r5flexsql_cursor); omessage := 'After Fetching select'; END IF; */ IF dbms_sql.is_open( r5flexsql_cursor ) THEN dbms_sql.close_cursor(r5flexsql_cursor); END IF; |