Oracle: How do I set a context variable? Here's a user context, and a package that sets a value in it.

create or replace context t1_ctx using t1_pkg accessed globally;

create or replace package t1_pkg
as
    procedure setx;
end t1_pkg;

create or replace package body t1_pkg
as
    procedure setx is
    begin
        dbms_session.set_context('t1_ctx','x','1');    
    end;
end t1_pkg;


But, it seems that I can't get the context variable set.  Both before and after the call to setx, 'x' remains NULL.

mh&gt; select sys_context('t1_ctx', 'x') from dual;
sys_context('t1_ctx','x') 
------------------------- 
NULL                      

mh&gt; exec t1_pkg.setx;

mh&gt; select sys_context('t1_ctx', 'x') from dual;
sys_context('t1_ctx','x') 
------------------------- 
NULL                      &lt;---- I expect this should be '1' ???


How do I set a variable in my user context?
The above works just fine.

SQL&gt; create or replace context t1_ctx using t1_pkg accessed globally;

Context created.

SQL&gt;

create or replace package t1_pkg
as
    procedure setx;
end t1_pkg;
/

Package created.

SQL&gt;

create or replace package body t1_pkg
as
    procedure setx is
    begin
        dbms_session.set_context('t1_ctx','x','1');
    end;
end t1_pkg;
/

Package body created.

SQL&gt; select sys_context('t1_ctx', 'x') from dual;

SYS_CONTEXT('T1_CTX','X')
--------------------------------------------------------------------------------


SQL&gt; exec t1_pkg.setx;

PL/SQL procedure successfully completed.

SQL&gt; select sys_context('t1_ctx', 'x') from dual;

SYS_CONTEXT('T1_CTX','X')
--------------------------------------------------------------------------------
1