I have sentry function, that sets application items after successful authentication. Then values of this itmes are accessed in pl/sql block that sets a context for the database session ("Edit application properties" - "Secutiry").
All works fine, but there is a problem if page runs from apex builder - values of this items are null!
Test case on apex.oracle.com:
1. run page 15 - http://apex.oracle.com/pls/apex/f?p=31741:15
2. values of items showed in region - they not null
3. login in apex builder. workspace: WS_AVER, user: VERSALAO, pass: qwerty%
4. go to page 15, run it from builder
5. values of items null!
6. change url in browser to http://apex.oracle.com/pls/apex/f?p=31741:15 (remove session id), then refersh - now all ok! values of item not null.
this is a bug? or my code has errors?
I found workaround!
If you use wwv_flow.fetch_flow_item(item_name,app_id,session_id) instead of v(item_name) - all ok!
It seems to me, that it is a bug in apex engine... or i am wrong?
I waiting for the response of apex developers :)
there seems indeed to be a case where our item value cache (used by the v function) is not yet properly initialized, at the time when the DB Session Initialization code is executed. The wwv_flow.fetch_flow_item function directly reads session state from the database, that's why it finds the values.
I'll file a bug, thank you for reporting this issue!