Main Tables Views Materialized Views Indexes Constraints Triggers Procedures Functions Packages Sequences Java Sources Sanity Check Index DDL scrips
Arguments Source

PXT_SESSION_CLEANUP

Arguments:

NameData TypeDefault ValueIn/Out
BOUND_INNUMBER(38) IN
COMMIT_INTERVALNUMBER(38) IN
BATCH_SIZENUMBER(38) IN
SESSIONS_DELETEDNUMBER(38) IN/OUT
DDL script

Source

Legend: comment string keyword reserved word operator
     1: procedure pxt_session_cleanup
     2:    (bound_in in number, commit_interval in number := 100,
     3: batch_size in number := 50000, sessions_deleted in out number)
     4: is
     5:    PRAGMA AUTONOMOUS_TRANSACTION;
     6:    cursor sessions (bound_val in number) is
     7:    select rowid from PXTSessions
     8:    where expires < bound_val;
     9:    counter number := 0;
    10: begin
    11:    for session in sessions (bound_in) loop
    12:       delete from PXTSessions where rowid = session.rowid;
    13:        counter := counter + 1;
    14:        if mod(counter, commit_interval) = 0 then
    15:           commit;
    16:        end if;
    17:       if counter >= batch_size then
    18:          commit;
    19:          sessions_deleted := counter;
    20:          return;
    21:       end if;
    22:    end loop;
    23:     commit;
    24:    sessions_deleted := counter;
    25: end;