Setting session state post-authentication

Hi all,
This application uses DATABASE ACCOUNT authentication, and has a post-authentication process that sets a few application items using code such as
apex_util.set_session_state('F_MY_ITEM', v_my_value);These items are used to secure certain tab options within the application.
The post-authentication PL/SQL works fine, I can't see anything wrong the the logic. I've debugged it and I know the values are being set. I'm checking the value of session state straight after using v('F_MY_ITEM'), along with checking my session ID matches up - everything seems ok there.
The issue is that when I log in, the session state is not set for those items - even though the post-auth process is called with no errors raised. Apex debug states
... Session State: Save "MY_ITEM" - saving same value "Y"If I log out, then log in (without closing browser tab), the values are now set as expected (visual confirmation using conditionally displayed tabs, and of course checking session state from developer toolbar)
Notably, Debug states something slightly different
... Session State: Save item "MY_ITEM" newValue="Y" escape_on_input="Y"There are a few other differences with the debug output, this this seems the most pertinent.
The only difference I've been able to track down is if I'm logged into the application builder in the same browser.
If I attempt to log in with a freshly opened browser, navigate directly to application URL, the behaviour works as expected. Tabs appear as if items are set.
Could the fact I'm authenticated in the application builder be messing with session state behaviour?
This is with Apex 4.0.2.00.07; agnostic to browser (IE/FF/Chrome); 11gr2
Cheers,
Scott

I did consider this because I experienced the same thing with page processes.
However, in this case my post-auth function is within a package and I don't use bind variables.
I was essentially doing this in my package:
apex_util.set_session_state('F_MY_ITEM', 'Y');
my_log_proc(v('F_MY_ITEM'));And seeing Y in the debug log, yet once on my home page, viewing session state I see F_MY_ITEM as empty - unless in the scenario I described.
It's not a showstopper since the users won't be logged in to the application builder, but it would be nice to know the cause.

Similar Messages

  • NEWBIE: Submit Page to set session state

    I have a form that displays various items to include Popup LOVs (dynamic; based on session variables). If the user displays a page, the session state is not yet set so the Popup LOVs don't function correctly (until the user presses the Apply Changes button to submit the page). Can I automatically submit the page or set session state for those items used in the LOVs on page load? Note that I'm not too familiar with the use of javascript. I'm using Application Express version 2.0

    Yes, I discovered that! Thanks for responding, though. I basically run a process (PL/SQL) under page rendering section that looks like:
    begin
    htmldb_util.set_session_state('P10_MACHINE_TYPE','&P10_MACHINE_TYPE.');
    end;
    Thanks!

  • Saving session state on authentication

    Hey all...
    In all my applications that interact with each other, I am running an application-level process on authentication which loads two preferences into applicaton-level items. I am seeing different results when jumping into different applications even though the executing code is the exact same in all applications, a stored procedure in the database. Here is a simplistic example.
    When application A calls a page in application B, an "on authentication" application-level process of application B reads two preferences and appropriately populates them into two application-level items of application B. When application A (or B for that matter) calls application C, the same-coded application process in application C attempts to populate two application-level items, but one of them is not being populated.
    It appears that the problem lies only with application C because regardless of whether I come from application A or application B, the same problem happens.
    When I go from application A to application B in debug mode, I see the following in reference to this problem:
    0.05: Computation point: ON_NEW_INSTANCE
    0.05: ...New Session = True
    0.05: Processing point: AFTER_AUTHENTICATION
    0.05: ...Process "Setup Seed Data": PLSQL (AFTER_AUTHENTICATION)
    1.11: ...Session State: Save Item "ORIGINAL_APP_ID" newValue="104" "escape_on_input="Y"
    1.11: ...Session State: Save Item "ORIGINAL_PAGE_ID" newValue="7" "escape_on_input="Y"
    When I go from either application A or application B to application C, I see the same debug messages except for an additional line that doesn't make sense to me. Following is an example:
    0.05: Computation point: ON_NEW_INSTANCE
    0.05: ...New Session = True
    0.05: Processing point: AFTER_AUTHENTICATION
    0.05: ...Process "Setup Seed Data": PLSQL (AFTER_AUTHENTICATION)
    1.11: ...Session State: Save Item "ORIGINAL_APP_ID" newValue="104" "escape_on_input="Y"
    1.11: ...Session State: Save Item "ORIGINAL_PAGE_ID" newValue="7" "escape_on_input="Y"
    <strong>1.11: ...Session State: Saved Item "ORIGINAL_APP_ID" New Value=""</strong>
    In all three applications, the exact same code is being run which determines if the preferences "is not null", and if so, sets the two preferences in the "current" application. I'm happy to show you the code of my stored procedure that does this if you like.
    The only thread I've seen in the forum that looks similar is the following:
    Re: Session state issues
    I've followed its suggestion of deleting and recreating the application-level item, but that did not solve my problem.
    I'm confused as to why the new line indicating "Saved Item" is showing up in the application C. Is there documentation available to explain the difference between "Save Item" and "Saved Item" when running a page in debug mode?
    Shane.

    Here are the different componets that are in play and some notes that may help understand the situation:
    - the failure happened when the two application-level processes below were just one process. works fine when they are split up.
    - the trick of using the SESSION as the USER_ID is because I want the preference to only be good for the session, not everytime the user logs in. ( i learned this trick from the ApEx forum! )
    - the stored procedure is in a package owned by a separate schema than the built-in ApEx user.
    On-Authentication Application-Level process with Sequence 10:
    begin
    :person_id := iv_portal.iv_emp_pkg.get_person_id ( v('USER') );
    apex_util.set_session_state ( 'PERSON_ID', :person_id );
    :core_app_id := iv_htmldb.iv_gen_pkg.get_core_app_id;
    apex_util.set_session_state ( 'CORE_APP_ID', :core_app_id );
    :user_vax_id :=
    substr ( iv_portal.iv_emp_pkg.get_vaxsub_id ( :person_id ), 1, 6 );
    apex_util.set_session_state ( 'USER_VAX_ID', :user_vax_id );
    :user_sub_id :=
    substr ( iv_portal.iv_emp_pkg.get_vaxsub_id ( :person_id ), 7, 1 );
    apex_util.set_session_state ( 'USER_SUB_ID', :user_sub_id );
    :proxy_person_id := apex_application.fetch_app_item
    ( 'PROXY_PERSON_ID', :original_app_id );
    apex_util.set_session_state ( 'PROXY_PERSON_ID', :proxy_person_id );
    end;
    On-Authentication Application-Level process with Sequence 15:
    declare
    l_username varchar2(50) := v('SESSION');
    begin
    iv_htmldb.iv_gen_pkg.setup_homepage_preferences ( l_username );
    end;
    SETUP_HOMEPAGE_PREFERENCES Stored Procedure
    procedure setup_homepage_preferences ( l_username in varchar2 ) is
    l_app_id varchar2(5) := v('APP_ID');
    l_page_id varchar2(5) := v('APP_PAGE_ID');
    l_pref_app_id varchar2(5) := null;
    l_pref_page_id varchar2(5) := null;
    begin
    -- clean up old sessions
    -- cannot do this however due to lack of access to the ApEx tables.
    delete from flows_020200.wwv_flow_preferences$ p
    where user_id != v('SESSION' )
    and user_id in ( select to_char ( id )
    from flows_020200.wwv_flow_sessions$ s
    where s.cookie = v('USER')
    and s.last_changed < sysdate - ( 0.5 ) );
    commit;
    if apex_util.get_preference ( 'ORIGINAL_APP_ID', l_username ) is null
    then -- then set the preference to the current application and page.
    apex_application.debug ( 'setting the ORIGINAL application items.' );
    apex_util.set_preference ( 'ORIGINAL_APP_ID', l_app_id,
    l_username );
    apex_util.set_preference ( 'ORIGINAL_PAGE_ID', l_page_id,
    l_username );
    else null;
    end if;
    -- set the application level items to the preference values
    l_pref_app_id := apex_util.get_preference ( 'ORIGINAL_APP_ID', l_username );
    l_pref_page_id := apex_util.get_preference ( 'ORIGINAL_PAGE_ID', l_username );
    apex_application.debug ( 'about to set ORIGINAL APP ID to ' || l_pref_app_id );
    apex_util.set_session_state ( 'ORIGINAL_APP_ID', l_pref_app_id );
    apex_application.debug ( 'just set ORIGINAL APP ID to ' ||
    apex_util.get_session_state ( 'ORIGINAL_APP_ID' ) );
    apex_application.debug ( 'about to set ORIGINAL PAGE ID to ' || l_pref_page_id );
    apex_util.set_session_state ( 'ORIGINAL_PAGE_ID', l_pref_page_id );
    apex_application.debug ( 'just set ORIGINAL PAGE ID to ' ||
    apex_util.get_session_state ( 'ORIGINAL_PAGE_ID' ) );
    end setup_homepage_preferences;
    Shane.

  • Set Session State with Shuttle items

    Is it possible to have session state set with each item selected in a shuttle? You have a shuttle with 4 possible options, you select item 2 from the left portion of shuttle and it is moved to the right.. Can you set the session state at that point?
    What I am trying to do is take the session state after change in the control and use it to populate a text field below. The returned values are used in a sql select to populate the text box with a looked up value...
    Thank you,
    Tony Miller
    Ruckersville, VA

    TexasApexDeveloper wrote:
    Won't this just push the last items value in, as apposed to appending the value?
    Tony,
    No. Because for shuttle items the return value is stored as colon delimited string.
    Means after each change you will have a colon delimited string in the session state with selected values(moved to right).
    See this http://apex.oracle.com/pls/apex/f?p=46417:47

  • Application Express - setting session state.

    I'm a relative newbie to APEX and am trying to set up and populate an application item into session state so that I can then have the value handy throughout the entire session and over all pages of the application. I've defined the item as FPC_Number in page Zero and have also set up a region in Page Zero where the FPC Number will be displayed across all pages of the application. It will not have a value until the user explicitly selects one from a drop down menu, so initially the value will be null. I'm having issues assigning the value. The value will not be assigned during the page rendering phase but at the page processing phase, correct? I have a computation set up as 'begin
    APEX_UTIL.SET_SESSION_STATE('F101_PROJECT_NUMBER',V('P14_PROJECT_NUMBER')); end; '. Does this look right? I get the error: PLS-00103 when I try to execute this. Any ideas?
    Update: I have deleted the calculation and am using a process only. I no longer get the PLS-00103 error message but still no value is displayed in Session_state.
    Edited by: V Rickert on Feb 26, 2013 7:38 AM

    V Rickert wrote:
    I'm a relative newbie to APEX and am trying to set up and populate an application item into session state so that I can then have the value handy throughout the entire session and over all pages of the application. I've defined the item as FPC_Number in page Zero and have also set up a region in Page Zero where the FPC Number will be displayed across all pages of the application. It will not have a value until the user explicitly selects one from a drop down menu, so initially the value will be null. I'm having issues assigning the value. The value will not be assigned during the page rendering phase but at the page processing phase, correct? I have a computation set up as 'begin
    APEX_UTIL.SET_SESSION_STATE('F101_PROJECT_NUMBER',V('P14_PROJECT_NUMBER')); end; '. Does this look right? I get the error: PLS-00103 when I try to execute this. Any ideas?
    Update: I have deleted the calculation and am using a process only. I no longer get the PLS-00103 error message but still no value is displayed in Session_state.APEX version?
    What type of item is "FPC_Number in page Zero"?
    Where is this process and when does it run?
    You said "I've defined the item as FPC_Number in page Zero", but the process is setting the value of F101_PROJECT_NUMBER&mdash;which looks like an application item&mdash;rather than "FPC_Number in page Zero".

  • Can't Set Session State from the Login Page

    I have a dilema. On the standard login page I enter values in 2 fields namely, CAMPUS (Select List) and USERNAME (text field).
    After clicking on the login button I want to navigate to PAGE 1 and use the values of CAMPUS and USERNAME to filter data. I have created two APPLICATION Level items (A_USERNAME,A_CAMPUS) to which I assign the values of USERNAME and CAMPUS in two AFTER SUBMIT computations on the login page.
    When I arrive on PAGE 1 the session state values of A_USERNAME,A_CAMPUS are still both null therefore the query returns null. It seems that the login process does not issue a SUBMIT for session state to be saved. How do I save the values in session state on login?
    In the Login PROCESS, can I specify the Page 1 items to be set and the values to set them in a URL somewhere? Is it here?
    wwv_flow_custom_auth_std.login(
    P_UNAME => :P101_USERNAME,
    P_PASSWORD => :P101_PASSWORD,
    P_SESSION_ID => v('APP_SESSION'),
    P_FLOW_PAGE => :APP_ID||':1' <<========here?
    If so what is the correct syntax?
    If I revisit the login page a second time, a submit is issued and the values are set in session state.
    Anyone got any ideas??
    I tried creating a standard position button which issues a submit but this didn't work either.
    regards
    Paul J Platt

    Unfortunately your solution is causing problems with retrieving cookies that I try to get for the campus and username during a "Before Header Process" as well. The cookies are normally set on an "After Submit" process. When I return to the login page I get
    Error ERR-1029 Unable to store session info. session=10760914996048113736 item=8561939526127479
    ORA-02291: integrity constraint (FLOWS_010600.WWV_FLOW_DATA_FK) violated - parent key not found
    But if I turn the cookies off, it seems to work OK.
    regards
    Paul JP

  • 4.2 select list on mobile page not setting session state

    Hi,
    Like I've done dozens of times in the past, I created a Select list that submits on change, and I expected session state to be updated accordingly.
    I tried this on a mobile page but session state is not updated for the item.
    Has anyone else experienced this?
    Scott

    Hi Scott,
    is it possible that you are hitting bug# 14680379 - PAGE SUBMIT ACTIONS DO NOT WORK FOR LONGER MOBILE SELECT LISTS, WHEN DEFINED TO FIRE WHEN THE SELECT LIST VALUE CHANGES
    on our Known Issues List http://www.oracle.com/technetwork/developer-tools/apex/application-express/apex-42-known-issues-1863578.html ?
    Is your select list selection displayed as native control or as popup? Can you create a test case on apex.oracle.com?
    Thanks
    Patrick
    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • Javascript setting value in session state

    I have a javascript that figures our the interest rate for a mortgage loan based on principal balance, term and monthly payment. The script also rounds up to the nearest 8th. Here is the line code that sets the value on the APEX form:
    document.getElementById('P2_NOTE_RATE_TO_PITIA_31').value = cRate.toFixed(3);
    Obviously this line code doesn't set session state for the value. Users have to submit the form again to pass this new rate to other calculations on the forms.
    Is there another piece of code I need to add to force value to session state? The javascript is called via the page load and it will produce the correct rate when ever values are changed to warrant a new interest rate to be calculated.
    Here is the entire javascript:
    function loanrate() { 
    function getVal(item){
    if($x(item).value != "")
    return parseFloat($x(item).value);
    else
    return 0 ;
    //Allow rates of 0 to 100%, solve to the nearest 0.001%
    var a=0.00001;
    var b=1;
    var tol=0.00001;
    var test;
    var t;
    var y1;
    var y2;
    var P = getVal('P2_NEW_BAL_CALC');
    var A = getVal('P2_NEW_PI_TARGET');
    var N = getVal('P2_REMAINING_TERM');
    var nRate;
    var cRate;
    var root;
    var TEMP = a;
    // Allow only 100 iterations (more than enough for convergence)
    for(var k = 1; k<=100; k++) {
    // A*(Math.pow((1+i),N)-1)/(i*Math.pow((1+i),N)) = present worth of N payments of A (beginning
    // 1 period from now)
    // Finally, subtract P (the present worth, or the price).
    i = a;
    y1 = A *(Math.pow((1+i),N)-1)/(i*Math.pow((1+i),N))- P;
    i = b;
    y2 = A *(Math.pow((1+i),N)-1)/(i*Math.pow((1+i),N))- P;
    test = y1*y2;
    // If test>0, the function that is to be driven to zero has the same sign
    // for both sides of the interval.
    if (test>0) {
    b = a;
    a = TEMP;
    a = (a+b)/2;
    } else {
    // If test <0, the root of the equation is between a and b.
    // If the interval is small enough, return (a+b)/2 as the root.
    // If not, bisect the interval: save a as TEMP, move a (new) halfway toward b.
    t = (b-a)/2;
    if (t<tol) {
    root = (a+b)/2;
    // Compute the annual compounded rate, if payments are monthly
    //var annual = 100*(Math.pow((1+root),12)-1);
    root = root * 100;
    nRate = Math.round(1000 * root)/1000 ;
    cRate = (Math.ceil((nRate * 12)/.125)*.125);
    document.getElementById('P2_NOTE_RATE_TO_PITIA_31').value = cRate.toFixed(3);
    //$x_Value('P4_ANNUAL_RATE',Math.round(1000*annual)/1000);
    break;
    } else {
    TEMP = a;
    a = (a+b)/2;
    }

    I believe the following will do what you need.
    document.getElementById('P2_NOTE_RATE_TO_PITIA_31').value = cRate.toFixed(3);
    var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=dummy',0);
    get.add('P2_NOTE_RATE_TO_PITIA_31',$x('P2_NOTE_RATE_TO_PITIA_31').value)
    gReturn = get.get();
    ...

  • Session state variables across multiple ApEx applications

    We have a suite of loosely integrate ApEx applications that all share a common authentication scheme. When you first log in we attempt to load a series of session state variables with temporary data to streamline various logging and authentication related activities for the life of the session.
    However, these session variables seem to disappear when you move from one application to another, so they are not truly tied to just the "session" which carries over across all applications, but the application from which the session state is set.
    What is the suggested way, keeping in mind that the data being held may have security related context, to preserve values during a session, but regardless of which ApEx application you are in.
    The method we are using to share the authentication is using a common "Cookie Name" from a common subscribed authentication scheme as suggested elsewhere on this site and seems to work very well outside of this specific issue.
    Thanks in advance,
    Barney

    Apologies for the delay getting back on this.
    My use of the word "disappear" was probably misleading. They were not visible from the second application. When setting "Session State" I was under the impression that it was setting it for the authenticated session, not for the specific application. (I am referring to the: apex_util.set/get_session_state).
    Your solution will work fine, as long as I know which application the user last authenticated against. However, it could be one of over 30 (and growing) different applications which would require me writing a program to go through every "p_flow" to try and find a valid value every time I need to reference the field.
    It would be really beneficial if you could store true Session variables which stay alive for the life of the authenticated session and is available to anything authenticated against that session id. This would streamline alot of cross-application program development.
    The "get/set_session_state" is a misleading as it is not a Session value, but an Application value. The Session exists across multiple applications, while this procedure does not.
    Thanks,
    Barney

  • Application Items/Session State Values and Page Branching

    I have users coming into a specific page in my application, passing in a value on the url that sets the value of an application item, where a validation routine occurs. If their session validates, I want to send them to one page, if it does not, I want to send them to a login error page.
    During validation, I am setting the values of several application items so that these values can be saved and used throughout their session. The values appear to be setting correctly. I am concerned that setting the application items may not be limiting these values to a particular session. So, I have also tried setting the setting session state variables with code like:
    apex_util.set_session_state ('F203_REQ', vReqID);
    I found it curious though when I ran this page, not trying to branch so I could check session state, these values showed up as being application items and I saw nothing under session variables.
    The problem I am having is that once validated I don't know how to branch to these other pages. I have tried adding some javascript in the header to force a page submit so that I could use a branch setup on the page. However, when it comes time to evaluate the branches (it's using one of the application item values I set earlier), I'm getting an error that no branch has been provided. Further research suggests the application item values are being cleared on the page submit.
    So, (1) I either need to know how to preserve those values on submit so the page branch works or (2) I need to branch to the new page without using a page submit and instead doing that in a some code (assuming submit is clearing application item values). I have not been able to find an example of how to do this in code. If there is a way to do this in code, will the application item or session state variable values be retained? I will need these values to be available to the user throughout their session.
    Thanks for the help,
    Steve

    Steve,
    I am concerned that setting the application items may not be limiting these values to a particular session.They are set in the current session only.
    It is hard to know what you are doing exactly without seeing it. If you set up an example on apex.oracle.com we could could address one specific question at at time.
    Scott

  • Item session state during rendering

    Hi,
    Application Express 4.1.0.00.32
    Page process (before heading) sets session state for several items (Text, Always replacing ..., Static Assignment...) but the values are not persistent.
    Debug shows:
    0.32451     0.00116     ...Session State: Saved Item "P1013_REC_PP" New Value="15"          
    0.32567     0.00104     ...Session State: Saved Item "P1013_TOT_AANT" New Value="1"
    0.32671     0.00111     ...Session State: Saved Item "P1013_CURR_SET" New Value="1"
    0.32783     0.00094     ...Session State: Saved Item "P1013_REC_PP" New Value=""
    0.32877     0.00087     ...Session State: Saved Item "P1013_TOT_AANT" New Value=""
    0.32963     0.00060     ...Session State: Saved Item "P1013_CURR_SET" New Value=""
    Where is the 'second round' (immediately following the actual setting in page process) on setting session state coming from?
    Thanks, Jos

    Resolved,
    Dropped the items and recreated some new ones (with different names) and now its OK.
    The original items were copied from each other and renamed. Maybe this is (still) a bug...
    Jos

  • Session State Protection - Arguments must have Checksum - Help Required

    Hi everyone,
    I am using apex 4.0 and have set:
    Session State Protection = True
    Page Access Protection = Arguments must have checksum
    Application Item Protection = Cecksum required - Session Level
    Page Data Entry Item Protection = Cecksum required - Session Level
    Page Display-Only Item Protection = Cecksum required - Session Level
    On pages which contain a Interactive report the calls to other pages to update and or delete a record passing the PK of the record work OK.
    I have set these as follows:
    In the Interactive report LInk Colomn --> Link Attribute = onclick="new top.Ext.apex.PopupWindow( { url: this.href, title: 'Edit Classification Details', width: 530, height: 500, listeners: {'success': gReport.search} } ).show(); return false;"
    Target = Page in this Application
    Page = 302Item = P302_IDCLASS
    Value = #IDCLASS#
    Page Checksum = - User Default -
    The problem is on the "Create new record" button which is located on the Interactive report page. I have defined the button as:
    Button Attributes = onclick="new top.Ext.apex.PopupWindow({ url:'f?p=&APP_ID.:302:&APP_SESSION.::NO:302::::', title: 'Create New Classification', width: 530, height: 500, listeners: {'success': gReport.search} }).show(); return false;"
    Action when button click = Redirect to Page in this Application
    Page = 302
    Clear Cache = 302
    When I click the button I get the following message:
    Session state protection violation: This may be caused by manual alteration of a URL containing a checksum or by using a link with an incorrect or missing checksum. If you are unsure what caused this error, please contact the application administrator for assistance.
    If I change the Button attributes to be:
    onclick="new top.Ext.apex.PopupWindow({ url:'f?p=&APP_ID.:302:&APP_SESSION.::NO:::::', title: 'Create New Classification', width: 530, height: 500, listeners: {'success': gReport.search} }).show(); return false;"
    It works OK, bu the page items are not clear.
    Could someone please explaing to me what am I doing wrong so I understand my mistake ?
    Thank you
    Daniel

    Here's an interesting situation. I have been having great results with the prepare_url function, until I needed to pass a column value from a report into a popup.
    Originally, in the Column Link --> URL in the Report Attributes I had this. This worked great when there was no session state protection enabled.
    javascript:popUp('f?p=&APP_ID.:17:&SESSION.::&DEBUG.:17:P17_EVENT_LOG_ID:#EVENT_LOG_ID#','450','375');When I enabled session state protection and changed the URL link to this
    javascript:popUp('&VW_EVENT_LOG.','450','375');and then created an application item and computation in order to pass a checksum along
    APEX_UTIL.PREPARE_URL (
      p_url => 'f?p=&APP_ID.:17:&SESSION.::&DEBUG.:17:P17_EVENT_LOG_ID:#EVENT_LOG_ID#',
      p_checksum_type => 3
    );the checksum seems to get passed fine, but the column value for the EVENT_LOG_ID is being concatenated to the end of the checksum instead of being passed as the value for P17_EVENT_LOG_ID. I also noticed that the clear cache page (17) looks like it is also being attached to the beginning of P17_.., but I'm not sure if that's to be expected or not.
    It took me a while to figure it out, but when I started looking at the error message closely, I could see that the checksum is identical except for the last two digits, which coincidentally are the same as the ID for this record.
    The checksum computed on the request, clear cache, argument names,
    and argument values (17P17_EVENT_LOG_ID [C6161B29B4C078F68DCF430133407754] ) did not match the checksum
    passed into the show procedure (C6161B29B4C078F68DCF43013340775490). Any thoughts on how to pass a column value with a checksum to a popup window?
    Thanks,
    Joe

  • Corrupt Session State? - Apex form posts text value as Null

    Recently I've discovered an issue with our Apex installation in which any value chosen as a source for a text field ends up being posted as a null to the database.
    We are running APEX version 3.2 within an Oracle 10.2.0.4 database using the Oracle HTTP Server from the 10g companion disk.
    At first glance, everything appears to function as expected; I have created a simple table called "oracle_sr" with 2 columns both not null:
    SQL> desc capacity.oracle_sr
    Name Null? Type
    ORACLE_SR_ID NOT NULL NUMBER
    TIMESTAMP NOT NULL DATE
    Within APEX the form wizard was used to create a form on this table.
    After executing the pages and entering a value for the timestamp field I can create records without issue.
    The issue arises when I choose a source value for the timestamp field.
    Any of the source options result in the same error (including a static value) so I will focus on the SQL Query for the source as:
    select sysdate from dual;
    This should substitute the system date within the timestamp text field when the page is executed.
    As expected, the value appears in the text box but when I submit the form to create the record I receive the error:
    ORA-01400: cannot insert NULL into ("CAPACITY"."ORACLE_SR"."TIMESTAMP")
    I have been working with APEX for quite some time and have successfully used this technique in many applications but just started to see this error over the past few days. What is particularly odd about this message is that default "not null" validations created by the form wizard sees the timestamp filed as having a value. The session state information included below is reporting a value yet the database is throwing the ORA-01400.
    Has anyone experienced a similar issue? I've spent a fair amount of time trying to research this issue but cannot seem to find any similar posts.
    I have included the debug output from my test page, from what I can see, there does seem to be a value associated with the timestamp filed:
    0.00: A C C E P T: Request="CREATE"
    0.00: Metadata: Fetch application definition and shortcuts
    0.00: NLS: wwv_flow.g_flow_language_derived_from=FLOW_PRIMARY_LANGUAGE: wwv_flow.g_browser_language=en-us
    0.00: alter session set nls_language="AMERICAN"
    0.00: alter session set nls_territory="AMERICA"
    0.00: NLS: CSV charset=WE8MSWIN1252
    0.00: ...NLS: Set Decimal separator="."
    0.00: ...NLS: Set NLS Group separator=","
    0.00: ...NLS: Set date format="DD-MON-RR"
    0.01: ...Setting session time_zone to -06:00
    0.01: Setting NLS_DATE_FORMAT to application date format: DD-MON-RR
    0.01: ...NLS: Set date format="DD-MON-RR"
    0.01: Fetch session state from database
    0.01: ...Check session 2303701116904676 owner
    0.01: Setting NLS_DATE_FORMAT to application date format: DD-MON-RR
    0.02: ...NLS: Set date format="DD-MON-RR"
    0.02: ...Check for session expiration:
    0.02: ...Metadata: Fetch Page, Computation, Process, and Branch
    0.02: Session: Fetch session header information
    0.02: ...Metadata: Fetch page attributes for application 109, page 50
    0.02: ...Validate item page affinity.
    0.02: ...Validate hidden_protected items.
    0.03: ...Check authorization security schemes
    0.03: Session State: Save form items and p_arg_values
    0.03: *...Session State: Save Item "P50_ORACLE_SR_ID" newValue="" "escape_on_input="N"*0.03: *...Session State: Save Item "P50_TIMESTAMP" newValue="26-MAY-09" "escape_on_input="N"*
    0.03: ...Session State: Save "P0_CURRENT_PERSONNEL_ID" - saving same value: "1"
    0.03: ...Session State: Save "P0_OFFSET" - saving same value: "0"
    0.03: ...Session State: Save "P0_ACTIVE_WEEK" - saving same value: "24-MAY-09"
    0.03: Processing point: ON_SUBMIT_BEFORE_COMPUTATION
    0.03: Branch point: BEFORE_COMPUTATION
    0.03: Computation point: AFTER_SUBMIT
    0.03: Tabs: Perform Branching for Tab Requests
    0.03: Branch point: BEFORE_VALIDATION
    0.03: Perform validations:
    0.03: ...Item Not Null Validation: P50_TIMESTAMP
    0.04: Branch point: BEFORE_PROCESSING
    0.04: Processing point: AFTER_SUBMIT
    0.04: ...Process "Get PK": PLSQL (AFTER_SUBMIT) declare function get_pk return varchar2 is begin for c1 in (select ORACLE_SR_SEQ.nextval next_val from dual) loop return c1.next_val; end loop; end; begin :P50_ORACLE_SR_ID := get_pk; end;
    0.04: ...*Session State: Saved Item "P50_ORACLE_SR_ID" New Value="6"*
    0.04: ...Process "Process Row of ORACLE_SR": DML_PROCESS_ROW (AFTER_SUBMIT) #OWNER#:ORACLE_SR:P50_ORACLE_SR_ID:ORACLE_SR_ID|IUD
    0.04: Show ERROR page...
    0.04: Performing rollback...
    ORA-01400: cannot insert NULL into ("CAPACITY"."ORACLE_SR"."TIMESTAMP")
    Unable to process row of table ORACLE_SR.
    Return to application.
    Any thoughts would be appreciated.
    Thank you,
    Justin.

    If you changed the Source Type of an item from Database Column to something else, then it cannot participate in the Automated Row Fetch/Automatic Row Processing (DML) choreography. You should leave the Source Type as it was and change the item's Default Value to populate it when the ARF process fetches a null for the column.
    Scott

  • Nothing set in session state after upgrade to 4.0.2

    hi -- I just patched up to 4.0.2 from 4.0.1. When I run my applications (any of them) nothing is showing
    in session state -- application items or page items. I don't think it's just an issue w/ the "session"
    reporting functionality because I'm also getting errors that indicate that values are not being set.
    Unfortunately, I did not export applications before the upgrade, or back up the database (though we
    have one from last night...).
    Help? Just want my apps working again!
    Thanks,
    Carol

    hi -- Well, you're on target:
    - I am using custom authentication (and apps that don't use it seem to work fine) - & -
    - The applications in question work fine when run directly.... that is, not via the developer.
    Unfortunately, I'm still having the problem after applying the patch. Actually, just once it did
    work... this was after I first applied the patch: I completely rebooted my machine and when I
    first went into the developer and ran it w/o doing anything else first, I didn't have the problem. Every
    time thereafter I have had the problem.... including after rebooting again.
    I have no reason to suspect the patch didn't work... very simple patch, no errors.
    For what it's worth... I can't say that I entirely tracked everything in the thread you pointed me to
    about sessions getting mixed up, but it does look like the session ids for developer vs the applications
    I'm running in developer are consistent throughout (at least, based on what I see in the URL). Is it
    normal that when I run an app via the builder, that the session_id that shows up on the login page
    is the developer session_id? A new session_id then shows when at the home page of the application...
    Any other ideas? Absolutely nothing is showing up in session state, anywhere. I'm very frustrated....
    I'm almost at the point where I want to use our latest database backup and revert back to 4.0.1. It doesn't
    have what I (apparently) need to get master/details working as I need them to, but at least I can proceed with
    other development!
    Hopefully there's an easier solution.
    Thanks,
    Carol

  • Use session state values to set column value during insert/update

    I am building an APEX 4.2 application that uses the canned Data Loading control to upload csv data to a table.  I have modified the 'Select Data Source' page of the workflow and it now contains three LOV's that the user selects values from.  The selected values are stored in Session State.  As I'm new to APEX, I do not know how to reference Session State objects in the context of the Data Loading workflow so that the appropriate columns are set with the correct values.  My assumption is that the columns that are apart of the insert statement reside in a collection somewhere.  I just don't know how to loop through the collection, determine the correct column, and then set that column's value equal to the corresponding LOV value in Session State.

    Scott,
    This is in version 2.2.1 and there are no caching features available.
    The application does require login.
    I'm playing around with the APP_UNIQUE_PAGE_ID right now but I am finding that even in the builder if I edit the attributes of a report column and then try to edit another column it will bring up the last column I edited. Even if I use the record navigation buttons next to the Apply Changes button it will keep bringing me the same page over and over unless I constantly refresh the pages.
    Greg

Maybe you are looking for