The first things I would investigate would be
#1 Do you REALLY have sticky sessions (could be misconfigured)
#2 Are ALL the session timeouts set properly?  Is the sticky session is set
to timeout after 5 minutes but the app server session times out after 10
minutes or visa versa.
#3 Is the user id in the correct case everywhere?  That is, is the perhaps 1
code path that it is used in a different manner (ideally the variable name
is a Global Constant right?)
#4 Are you navigating from a jsp (or whatever) html form that has the userid
set to "" or it isn't present?
#5 Are you inadvertently, unknowingly creating new sessions?

<<An Obstacle is something you see when you take your eyes off the goal>>

-----Original Message-----
From: Daniel Haynes [mailto:[EMAIL PROTECTED] 
Sent: Monday, May 17, 2004 7:32 AM
To: [EMAIL PROTECTED]
Subject: DynaActionForm/DynaValidatorForm 'losing' state


****************************************************************************
******************
Your attention is drawn to the warning notice at the end of this message.
****************************************************************************
******************

An intermittent bug is occurring on a live struts based application. A value
is being set on a DynaActionForm variable (userId ) when a user navigates to
the screen. However when the user submits the resultant form the value is
lost (its becomes null). The bug appears on the live system and then
disappears with no apparent consistency. The DynaActionForm is configured
with session scope. The form has been extended with an implemention of the
reset method (as below) which seems to continually set this form attribute
with a value. My guess then is that the only way this value can be null is
when the form bean is first created (it is not configured with an 'initial'
value). Although using ValidatorForm, validation is done manually rather
than through the validation configuration.

public class UserDynaValidatorForm extends DynaValidatorForm
{
    public void reset(ActionMapping mapping,
javax.servlet.http.HttpServletRequest request)
    {
        HttpSession session = request.getSession();
        DynaActionForm dynaForm =
(DynaActionForm)session.getAttribute("userInputNav");
        String userId = "0";
        if(dynaForm.get("userId")!=null) {
          userId=(String)dynaForm.get("userId");
        }
        super.getMap().clear();
        dynaForm.set("userId",userId);
        session.setAttribute("userInputNav",dynaForm);
    }
}

The application is running on Oracle9iAS Release 2 on one machine using a
two node cluster with Web Cache enabled and configured for 'sticky'
sessions.

Does anyone have any ideas about what might be happening here, and why it
might be happening, or has had experience of something similar ?

Many thanks





****************************************************************************
*******
We would ask you to treat any communication from us as confidentially as you
would want us to treat communication from you.  If you are not an intended
recipient, please notify [EMAIL PROTECTED] immediately. You should know
that some of our communications may contain confidential information which
it could be a criminal offence for you to disclose or use without authority.
This e-mail is not intended nor should it be taken to create any legal
relations, contractual or otherwise. The Financial Services Authority 
25 The North Colonnade, Canary Wharf, London E14 5HS United Kingdom
Registered as a Limited Company in England and Wales No.1920623. Registered
Office as above 
Switchboard: 020 7066 1000
Web Site:   http://www.fsa.gov.uk
****************************************************************************
*******


-----------------------------------------
This message and its contents (to include attachments) are the property of Kmart 
Corporation (Kmart) and may contain confidential and proprietary information. You are 
hereby notified that any disclosure, copying, or distribution of this message, or the 
taking of any action based on information contained herein is strictly prohibited. 
Unauthorized use of information contained herein may subject you to civil and criminal 
prosecution and penalties. If you are not the intended recipient, you should delete 
this message immediately.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to