Replicated session state with WLS 5.1 sp 6 in cluster

          Hello, i've seen in BEA documentation this:
          Applications Using Frames Must Coordinate Session Access
          If you are designing a web application that utilizes multiple frames, keep in mind
          that there is no synchronization of requests made by frames in a given frameset.
          For example, it is possible for multiple frames in a frameset to create multiple
          sessions on behalf of the client application, even though the client should logically
          create only a single session.
          In a clustered environment, poor coordination of frame requests can cause unexpected
          application behavior. For example, multiple frame requests can "reset" the application's
          association with a clustered instance, because the proxy plug-in treats each request
          independently. It is also possible for an application to corrupt session data by
          modifying the same session attribute via multiple frames in a frameset.
          To avoid unexpected application behavior, always use careful planning when accessing
          session data with frames. You can apply one of the following general rules to avoid
          common problems:
          ·     In a given frameset, ensure that only one frame creates and modifies session data.
          ·     Always create the session in a frame of the first frameset your application uses
          (for example, create the session in the first HTML page that is visited). After the
          session has been created, access the session data only in framesets other than the
          first frameset.
          My environment is clustered(multi-tier) and jsp and servlets use frameset, could
          you explane this?
          I don't understand very well
          Thanks and regards
          Fabio
          

          Thanks for you suggest!
          Fabio
          "Mike Reiche" <[email protected]> wrote:
          >
          >It means that all the jsps executed from the same browser use the same
          >httpsession
          >- so be aware of it.
          >
          >If the jsp in the first frame does ---
          >
          > httpSession.put("MYNAME", "GOODVALUE");
          >
          >and the jsp the second frame does ....
          >
          > httpSession.put("MYNAME", "BADVALUE");
          >
          >then the jsp in the first frame does ...
          >
          > value = httpSession.get("MYNAME");
          >
          >You might get "GOODVALUE" or you might get "BADVALUE" since both
          >JSPs execute concurrently without synchronization and they both store
          >something under
          >the same key in the same httpSession.
          >
          >Mike
          >
          >"Fabio Rossi" <[email protected]> wrote:
          >>
          >>Hello, i've seen in BEA documentation this:
          >>
          >>Applications Using Frames Must Coordinate Session Access
          >>
          >>If you are designing a web application that utilizes multiple frames,
          >keep
          >>in mind
          >>that there is no synchronization of requests made by frames in a given
          >frameset.
          >>For example, it is possible for multiple frames in a frameset to create
          >>multiple
          >>sessions on behalf of the client application, even though the client
          >should
          >>logically
          >>create only a single session.
          >>In a clustered environment, poor coordination of frame requests can
          >cause
          >>unexpected
          >>application behavior. For example, multiple frame requests can "reset"
          >the
          >>application's
          >>association with a clustered instance, because the proxy plug-in treats
          >>each request
          >>independently. It is also possible for an application to corrupt session
          >>data by
          >>modifying the same session attribute via multiple frames in a frameset.
          >>To avoid unexpected application behavior, always use careful planning
          >when
          >>accessing
          >>session data with frames. You can apply one of the following general
          >rules
          >>to avoid
          >>common problems:
          >>·     In a given frameset, ensure that only one frame creates and modifies
          >session
          >>data.
          >>
          >>·     Always create the session in a frame of the first frameset your application
          >>uses
          >>(for example, create the session in the first HTML page that is visited).
          >>After the
          >>session has been created, access the session data only in framesets
          >other
          >>than the
          >>first frameset.
          >>
          >>My environment is clustered(multi-tier) and jsp and servlets use frameset,
          >>could
          >>you explane this?
          >>I don't understand very well
          >>
          >>Thanks and regards
          >>Fabio
          >>
          >
          

Similar Messages

  • 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

  • Compare Old Value (Session State) with New Value on Submit.

    Hi all,
    Is there an easy way to do comparison of Old Value (Session State Value) with the New Value?
    is there an API for that? like what we have in PLSQL Trigger :NEW & :OLD
    Thanks before
    -Joel

    There is only one version of session state available for examination at any point during page rendering or processing, the current version. Can you explain more about what you need?
    Scott

  • Session state replication taking time to replicate in weblogic cluster

    I have a application fully serialized code with WEB-INF/lib containing the below configs with Unicast communication.
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE weblogic-web-app PUBLIC "-//BEA Systems, Inc.//DTD Web Application 8.1//EN" "http://www.bea.com/servers/wls810/dtd/weblogic810-web-jar.dtd">
    <weblogic-web-app>
      <session-descriptor>
        <session-param>
          <param-name>TimeoutSecs</param-name>
          <param-value>1800</param-value>
        </session-param>
                    <cookie-http-only>false</cookie-http-only>
      <persistent-store-type>replicated_if_clustered</persistent-store-type>
                    </session-descriptor>
    </weblogic-web-app>
    OHS plugin is having below config
    LoadModule weblogic_module   "${ORACLE_HOME}/ohs/modules/mod_wl_ohs.so"
    <IfModule mod_weblogic.c>
    WebLogicCluster 172.12.113.141:7006,172.12.113.140:7006
            MatchExpression /finapp/*
    </IfModule>
    And weblogic cluster is replicating session instantly when ever there is some activities happening in the application.
    It is having a problem only in below scenario when the session is open but the user is not doing anything.
    I have 2 nodes in the cluster if one goes down(currently request serving one) it is failing over to the next but the session is not getting copied instantly. Below is the scenario where it works fine and where the replication is delayed.
    1. Both servers(server1,server2) up for some time and user logs in and is continuing work.
    2. primary server(server1) crashes in middle, secondary(server2) will take over the existing session and you will see user will be continuing the work without any issues(no logouts).
    3. After sometime server1 comes up online, user keeps on testing(clicking some tab which makes a request to server), you will see the server1 will have a replica of server2 instantly.
    4. You can bring down the server2 now and you will see the users session will not interrupt and user will be able to continue session with the server1.
    Now coming to the scenario where you will be able to delayed replication :
    1. Both servers up and user logged in and started work.
    2. Primary server(server1) goes down and secondary server(server2) will take over the session and let the user continue its work without any logout.
    2. server1 comes back online and user is not doing anything(no clicks) with application just kept the session open and server2(primary session) goes down within the replication time then the user will get logged out and might see some erratic behavior in any applications deployed to that weblogic. (We saw that if we dont shutdown server2 immediately(within 1min) and wait for 5mins+ weblogic is copying  the session from server2 to server1. After that copy if we shutdown the primary server(server2) user is not having any issues)
    To summerize if a session is active(logged in) and some activity(clicking) is going on then replication is happening instantly from primary to secondary but if the user is active(logged in) and not doing anything(not clicking) then the session from primary to secondary is taking 5minutes+
    Please let me know if there is some weblogic configs to check to reduce this time lag and let weblogic copy the session continuously either the user is performing any activity or not in the logged in session.
    Thanks,

    Hi,
    This is the expected behavior. Please take a look at this document: WebLogic Server - Session Replication/Failover Scenario When Only One Server In Cluster is RUNNING (Doc ID 1292033.1)
    In a WebLogic Server domain, with a Cluster of 2 Managed Servers and a web application deployed on this Cluster, you have only one managed server running and then you make a request through a proxy server to access the application.
    The default cookie which is JSESSIONID will be created something like
    <SessionID>!<PrimaryJVMID>!NONE
    Here, you see the secondary server as NONE as there is only one server in cluster running.
    Now, you leave HTTP session idle, meaning there will be no activity and requests in it.
    Now, you bring up the second managed server instance in the cluster. The JSESSIONID for the earlier created HTTPSession will be unchanged: still
    <SessionID>!<PrimaryJVMID>!NONE
    unless there are any requests made or activity in it.
    At this point of time, if there is a failure of the Managed server, the idle in-flight HTTP Sessions which were created earlier when this managed server was RUNNING, will be dropped and there will be no failover. Only active HTTP Sessions which have a secondary JVM ID will be failed over to the secondary managed server.
    At any point, if subsequent requests are made and if any activity is made to the Idle HTTP sessions which were earlier created, the JSESSIONID gets updated with the secondary JVMID and sessions gets replicated and failed over in case of server crash.

  • Setting Checkbox & Radio session state (AJAX)

    These functions will set the session state of a checkbox and radio items using Ajax.
    Any feedback is welcomed!
    // AJAX Checkbox Session
    function setCheckboxSession('P1_CHECKBOX'){
         var get = new htmldb_Get(null,html_GetElement('pFlowId').value,null,0);
         get.add(pSource,html_CheckboxValue('P1_CHECKBOX'));
         gReturn = get.get('XML');
         get = null;     
    function html_CheckboxValue(pItemId){
         var boxes=html_GetCheckbox(pItemId);
         var l_val='';
         for (var j=0;j<boxes.length;j++){
              if (boxes[j].checked){
                   l_val = boxes[j].value;
                   break;
         for (var i=j+1;i<boxes.length;i++){
              if (boxes.checked){
                   l_val = l_val+':'+boxes[i].value;
         return l_val;
    function html_GetCheckbox(pItemId){
    var l_array=new Array();
    var re=new RegExp('^'+pItemId.toUpperCase()+"_[0-9]+$");
    var inputs=document.getElementsByTagName('input');
    for (var j=0,l=inputs.length;j<l;j++)
    if (inputs[j].type=="checkbox" && inputs[j].id && inputs[j].id.match(re))
    l_array[l_array.length]=inputs[j];
    return l_array;
    // AJAX Radio Session
    function setRadioSession('P1_RADIO'){
         var get = new htmldb_Get(null,html_GetElement('pFlowId').value,null,0);
         get.add(pSource,html_RadioValue('P1_RADIO'));
         gReturn = get.get('XML');
         get = null;

    check this
    Re: Modifying session state with javascript

  • Format Mask in Session state

    In a Summary Region (Page 6) I have changed one field to text, edited the field with no format mask. In the entry form on the pervious page, the column properties are Database Column, and Always replace value in Session State with the Money format Mask.(Page 5).
    10313     5     P5_LPP     Text     $66.67 LPP
    10313     6     P6_ENGAGER_LPP     Text Field     $66.67     I
    Question is that the field in field 6 displays the value $66.67. Why not 66.67?
    On Page 6 a user can press the Update_lpp button and Invalid Number Error Page pops up?
    Is there a way to hold in the session state the values only while formatting on the screen is $'
    Thanks

    Thanks. I did an "on submit and before computation" process that did a SQL replace on the page item. The DML process then successfully inserted the value into the database.
    Alex.

  • NullPointer with Replicated Session

              I'm running on a 2-node Solaris cluster with WLS 8.1 sp1. When testing failover,
              the session is replicated correctly to the secondary server. However, if the
              page being tested with failover uses session.setAttribute, the following error
              is received:
              java.lang.NullPointerException
                   at weblogic.servlet.internal.session.SessionData.setAttribute(SessionData.java:563)
                   at weblogic.servlet.internal.session.ReplicatedSessionData.setAttribute(ReplicatedSessionData.java:438)
              I've checked and everything appears to be serializable (no WLS errors and in a
              non-clustered environment, I'm able to write the session out to file). Is this
              an issue with WLS?
              

              I'm running on a 2-node Solaris cluster with WLS 8.1 sp1. When testing failover,
              the session is replicated correctly to the secondary server. However, if the
              page being tested with failover uses session.setAttribute, the following error
              is received:
              java.lang.NullPointerException
                   at weblogic.servlet.internal.session.SessionData.setAttribute(SessionData.java:563)
                   at weblogic.servlet.internal.session.ReplicatedSessionData.setAttribute(ReplicatedSessionData.java:438)
              I've checked and everything appears to be serializable (no WLS errors and in a
              non-clustered environment, I'm able to write the session out to file). Is this
              an issue with WLS?
              

  • Problem with application item and session state

    Okay, let's see if I can explain this problem coherently.
    I have a small app (one page), with an application item, F_WHERE_CLAUSE.
    This page has three regions in which there are items that the users can populate for search conditions. A couple of these items are "select list with submit" (I still need to upgrade to the AJAX method, I know). There is another region which has one hidden field, called P1_WHERE_CLAUSE. This field is defined to "Always, replacing any value in session state..." with source type of "Item (application or page.....", and a source value of F_WHERE_CLAUSE with no default value.
    I have a button called "Search" which submits the page and fires a PL/SQL process which builds a where condition based upon the other page items and stores the value to the application item F_WHERE_CLAUSE (correctly).
    For testing, I've made the P1_WHERE_CLAUSE field visible so that I can see what's going on. I've also clicked the debug and session buttons to help trace this. After I click the "Search" button and the page submits, debug shows:
    0.02: ...Session State: Save "P1_WHERE_CLAUSE" - saving same value: "1=1"
    followed later by:
    0.05: ...Session State: Saved Item "F_WHERE_CLAUSE" New Value="lower(primary_class) = 'rock' and country = 'Spain'"
    The field P1_WHERE_CLAUSE displays with the correct search criteria as signified by F_WHERE_CLAUSE above. However, If I click the "session" button to view the session state values, P1_WHERE_CLAUSE shows up as:
    P1_WHERE_CLAUSE Textarea    1=1    U while F_WHERE_CLAUSE displays the correct value still.
    The reason this "problem" came up, is that this page also has three SQL report regions which use &P1_WHERE_CLAUSE. for the where condition. While they display the correct results on-screen, each report region also has the "Export to csv" enabled, and the export seems to be using the "1=1" condition (from the "session" window) instead of the search criteria that the on-screen region is using (F_WHERE_CLAUSE and the displayed P1_WHERE_CLAUSE), resulting in a retreival of all records.
    Anybody have any idea what's going on and why, and how to get the csv export to use the correct value for the where condition?
    Thanks,
    Bill Ferguson

    It appears the "Export to CSV" functionality requires the item value to be set in session state. The P1_WHERE_CLAUSE item value never gets saved to session state. The page is rendered and the value is put in the item on the page but until you submit the page session state doesn't know what P1_WHERE_CLAUSE is.
    Create a before header computation or process to set the value of P1_WHERE_CLAUSE (which will save it to session state). It is interesting that the report regions didn't need to look at the value in session state but the "export to csv" does.
    --Jeff                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Simple jsp to show if session state is being correctly replicated ?

              Hello,
              I am making a simple jsp to show if session state is being correctly replicated.
              I just remembered seeing one somewhere before.
              It showed the server-name, and the number of request so far in the session. And
              maybe a nice bea logo.
              Does anyone know where such a thing might be available ?
              thanks!
              JM
              

              Hi ,
              checkout bea samples there is such jsp in cluster/sessionrep or something like
              this /bea_home/samples/sever...
              "Marmelstein" <[email protected]> wrote:
              >
              >Hello,
              >I am making a simple jsp to show if session state is being correctly
              >replicated.
              >I just remembered seeing one somewhere before.
              >It showed the server-name, and the number of request so far in the session.
              >And
              >maybe a nice bea logo.
              >Does anyone know where such a thing might be available ?
              >thanks!
              >JM
              

  • Need help with the session state value items.

    I need help with the session state value items.
    Trigger is created (on After delete, insert action) on table A.
    When insert in table B at least one row, then trigger update value to 'Y'
    in table A.
    When delete all rows from a table B,, then trigger update value to 'N'
    in table A.
    In detail report changes are visible, but the trigger replacement value is not set in session value.
    How can I implement this?

    You'll have to create a process which runs after your database update process that does a query and loads the result into your page item.
    For example
    SELECT YN_COLUMN
    FROM My_TABLE
    INTO My_Page_Item
    WHERE Key_value = My_Page_Item_Holding_Key_ValueThe DML process will only return key values after updating, such as an ID primary key updated by a sequence in a trigger.
    If the value is showing in a report, make sure the report refreshes on reload of the page.
    Edited by: Bob37 on Dec 6, 2011 10:36 AM

  • Monitor historical session resources with sql statements

    Hi,
    I would like to write some queries to retrieve the following data from my database:
    For a certain day, give me the total
    physical read total bytes
    physical write total bytes
    cpu usage?
    from my sessions in the database. I have specific groups I want to monitor, certain logon users that run the same batch program.
    I guess the above stats are waits although I 'm not sure about cpu usage.
    Can I monitor this with dba_hist_active_sess_history? How do I translate the waits named above to the dba_hist_active_sess_history columns? I know this view only holds data for about 7 days, but that is fine.
    Kind regards,
    Nico

    I am almost there now. But this only works on Oracle 10.2
    On my Oracle 10.1 databases the wait_class and session state fields do not seem to be defined in:
    - v$active_session_history
    - dba_hist_active_sess_history
    Any ideas where I could find these in 10.1?
    regards
    SELECT * FROM (
    select
    --ash.session_id,
    u.username,
    ash.program,
    ash.MODULE,
    ash.session_state,
    Nvl(ash.wait_class,'Other') wait_class,
    sum(decode(ash.session_state,'ON CPU',1,0)) "CPU",
    sum(decode(ash.session_state,'WAITING',1,0)) -
    sum(decode(ash.session_state,'WAITING',
    decode(ash.wait_class,'User I/O',1, 0 ), 0)) "WAITING" ,
    sum(decode(ash.session_state,'WAITING',
    decode(ash.wait_class,'User I/O',1, 0 ), 0)) "IO"
    from v$active_session_history ash,
    --dba_hist_active_sess_history ash,
    dba_users u
    WHERE u.user_id = ash.user_id
    group by username,program,MODULE,session_state,wait_class
    order by cpu DESC

  • A jsp which shows that session state is replicated ?

              Hello,
              I am making a simple jsp to show if session state is being correctly replicated.
              I just remembered seeing one somewhere before.
              It showed the server-name, and the number of request so far in the session. And
              maybe a nice bea logo.
              Does anyone know where such a thing might be available ?
              thanks!
              JM
              

              I thought I included the attachment?!
              "Vijay" <[email protected]> wrote:
              >
              >Hope this helps...
              >
              >G'luck.
              >Vijay
              >
              >"Marmelstein" <[email protected]> wrote:
              >>
              >>Hello,
              >>I am making a simple jsp to show if session state is being correctly
              >>replicated.
              >>I just remembered seeing one somewhere before.
              >>It showed the server-name, and the number of request so far in the session.
              >>And
              >>maybe a nice bea logo.
              >>Does anyone know where such a thing might be available ?
              >>thanks!
              >>JM
              >
              

  • Why many sessions with alter session statements?

    Currently we are using Oracle 8.1.7 on Tru64Unix and connect with this database via OC4J904. We find many inactive sessions indicated with the SQL statement:
    ALTER SESSION SET NLS_LANGUAGE = 'AMERICAN'
    But nobody explicitly issues this statement. How does this occur?

    What is your NLS_DATABASE_PARAMETER 'NLS_LANGUAGE'?
    For example:
    SQL> SELECT * FROM NLS_DATABASE_PARAMETERS
    2 WHERE PARAMETER = 'NLS_LANGUAGE';
    PARAMETER VALUE
    NLS_LANGUAGE AMERICAN
    What is the value of the environment variable 'NLS_LANG' for your session?
    On my computer it is:
    AMERICAN_AMERICA.WE8MSWIN1252
    You can find some useful information here:
    http://download-west.oracle.com/docs/cd/B13789_01/server.101/b10749/ch3globe.htm#1006332

  • Problems With Session State Protection

    I have enables SSP on one of my applications and everyting seemed ok until I reached a page with a custom pop up page.
    I use this code in my page header
    {} used to display code
    {<script language="JavaScript1.1" type="text/javascript">
    function callMyPopupRank (formItem1,formItem2) {
    var formVal1 = document.getElementById(formItem1).value;
    var formVal2 = document.getElementById(formItem2).value;
    var url;
    url = 'f?p=&APP_ID.:115:&APP_SESSION.::::P115_RANK,P115_RANK_ID:' + formVal1;
    w = open(url,"winLov","Scrollbars=1,resizable=1,width=400,height=630");
    if (w.opener == null)
    w.opener = self;
    w.focus();
    </script>}
    Then I call it from post element text of an item
    {<img src="#IMAGE_PREFIX#edit-white.gif" border="0" alt="Edit">}
    When my pop up page opens I get this error
    Attempt to save item P115_RANK in session state during show processing.
    Item protection level indicates "Item may be set when accompanied by a "session" checksum.".
    No checksum was passed in or the checksum passed in would be suitable for an
    item with protection level "(No checksum was provided)".
    How do I append the checksum to my url ?
    Thanks
    Gus
    Edited by: Gus C on Jan 8, 2010 1:50 AM
    Edited by: Gus C on Jan 8, 2010 1:52 AM

    You will need to use the APEX_UTIL.PREPARE_URL function to append the checksum to the URL. I would suggest you use a hidden page item to hold the URL and then reference it in your JS.
    I hope that helps
    Shunt

  • Submitting the value of an item with session state

    Hi,
    I've a Master / Detail Form on different pages, like master report page no.19, master form page no. 20 and detail form page no. 21. I've created this form using Form, master detail form wizard. I've set deptid as a primary key in master, and foreign key in details table. In page 21, i've set the source for deptid, source used : Always, replacing any existing value in session state, source type : Item (application or page item name), source value : P20_DEPTID. While executing the form deptid is showing the value, but, while submitting of the form, it's not saving in the table. What will be the problem??
    Thanks and Regards,
    Sudha.

    Sudha,
    OK.
    Go to the pagedefintion in page 20, click on the wordt report (of your master form).
    You will get a new screen.
    Click on the pencil-icon of your column.
    Again a new screen.
    Select the six tab (it's called LINK).
    Enter item-name and value something like :p21_dept_id and #DEPT_ID#
    where P21_dept_id is the item of the form for the dept_id
    Hope this helps.
    Leo

Maybe you are looking for