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: 
     7:    cursor sessions (bound_val in number) is
     8:    select rowid from PXTSessions
     9:    where expires < bound_val;
    10: 
    11:    counter number := 0;
    12: 
    13: begin
    14: 
    15:    for session in sessions (bound_in) loop
    16: 
    17:       delete from PXTSessions where rowid = session.rowid;
    18: 
    19:        counter := counter + 1;
    20:        if mod(counter, commit_interval) = 0 then
    21:           commit;
    22:        end if;
    23: 
    24:       if counter >= batch_size then
    25:          commit;
    26:          sessions_deleted := counter;
    27:          return;
    28:       end if;
    29: 
    30:    end loop;
    31: 
    32:     commit;
    33: 
    34:    sessions_deleted := counter;
    35: 
    36: end;