You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Preston CRAWFORD <Pr...@state.or.us> on 2005/10/06 20:06:35 UTC

Re: Struts action forms crossing sessions?Anyideawhythisishappening?

Yes on the first one. 

We are calling session.invalidate() on logoff. Even more, if you close down the browser AND logout you still come back and the object is there.

Preston

>>> gareth.evans@msoft.co.uk 10/6/2005 2:04:13 AM >>>
I take it your using hibernate to load and object from the database and prepopulate the form with data?

If so check the hashcode of this object before you populate the actionform.  It could be that 
hibernate is returning you a cached object rather than a new object each time.

If you are storing data within the session, are you calling session.invalidate() when the user logs off?

Regards,

Gareth

Preston CRAWFORD wrote:

> This is why I haven't sent code. Because I am narrowing it down already.
> Same behaviour on WebSphere as of yesterday. Behaviour isn't exhibited
> when the object in question isn't created as a result of Hibernate, but
> rather populated manually as you suggested. So we have it narrowed down
> somewhat. It seems like a Hibernate problem, at this point. That the
> angle we're working on.
> 
> Preston
> 
> 
>>>>szabtam@gmail.com 10/4/2005 5:20:28 PM >>>
> 
> Well, if you don't send us the code it's hard to help with this one...
> :-)
> 
> You should try to narrow down things that could cause the behaviour.
> For examle:
> - Try to deploy to another server to be sure that it is not a Tomcat
> bug.
> (if you just want to be sure that it's not cause by the 5.0.x bug you
> can
> try to
> deploy to Tomcat 5.5.x )
> - Try to eliminate Hibernate from the process, I mean populate the
> object
> with hard coded data and put that in session.
> - I don't know how do you populate the objects, if it's a complicated
> process
> try to take out some of the functionality temporary until you get to
> the
> point
> when it does work.
> 
> Tamas
> 
> On 10/4/05, Preston CRAWFORD <Pr...@state.or.us> wrote:
> 
>>Well, a lot changed yesterday. I took all forms out of session and
> 
> it's
> 
>>still happening. I did much tinkering and discovered that it's any
>>object in session (so in this case the container object for the
>>ArrayList that gets set to the form) that's crossing sessions and
>>STICKING in session as well (as in I'll logout, shut down the
> 
> browser,
> 
>>open up the browser and there it is again). So this has me wondering
> 
> if
> 
>>it's related to hibernate, which we are using to populate this
> 
> object.
> 
>>Preston
>>
>>
>>>>>szabtam@gmail.com 10/4/2005 3:31:29 AM >>>
>>
>>On 10/4/05, Preston CRAWFORD <Pr...@state.or.us> wrote:
>>
>>>No. What information would be useful and relevant? Struts-config?
>>
>>The
>>
>>>form bean itself? The action, the JSP? I didn't want to overload
> 
> the
> 
>>>list, obviously.
>>
>>
>>
>>In the following code how do you populate and set the myArrayList
>>property
>>of the myFormBean?
>>If all the myFormBean instances have a reference to the same
> 
> ArrayList
> 
>>or
>>the ArrayLists are not the same
>>but the items from the ArrayList reference the same objects then all
>>users
>>modify and see the same
>>values...
>>
>><c:if test="${! empty myFormBean.myArrayList}">
>><c:forEach items="${myFormBean.myArrayList}" var="item"
>>varStatus="loop">
>><c:out value="${item.memberField}" /><br />
>></c:forEach>
>></c:if>
>>
>>
>>Preston
>>
>>
>>Tamas
>>
>>
> 
> ---------------------------------------------------------------------
> 
>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org 
>>For additional commands, e-mail: user-help@struts.apache.org 
>>
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org 
> For additional commands, e-mail: user-help@struts.apache.org 
> 
> 

-- 
Gareth Evans

MSoft eSolutions Limited
Technology Centre
Inward Way
Rossmore Business Park
Ellesmere Port
Cheshire
CH65 3EN

-- 
Tel:    +44 (0)870 0100 704
Fax:    +44 (0)870 9010 705
E-Mail: gareth@msoft.co.uk 
Web:    www.msoft.co.uk 

----------------------------------------------
Terms:
Please note that any prices quoted within this e-mail are subject to VAT.
All program details and code described in this e-mail are subject to
copyright © of MSoft eSolutions Limited and remain the intellectual
property of MSoft eSolutions Limited.
Any proposal or pricing information contained within this e-mail are
subject to MSoft eSolutions' Terms and Conditions
----------------------------------------------
Disclaimer:
This message is intended only for use of the addressee. If this message
was sent to you in error, please notify the sender and delete this
message. MSoft eSolutions Limited cannot accept responsibility for viruses,
so please scan attachments. Views expressed in this message do not
necessarily reflect those of MSoft eSolutions Limited who will not
necessarily be bound by its contents.



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org 
For additional commands, e-mail: user-help@struts.apache.org 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts action forms crossing sessions?Anyideawhythisishappening?

Posted by Andre Van Klaveren <ny...@gmail.com>.
I'm dieing to hear if you solved this issue. Sounds like a Hibernate caching
problem after I read the rest of the posts.



On 10/6/05, Preston CRAWFORD <Pr...@state.or.us> wrote:
>
> Yes on the first one.
>
> We are calling session.invalidate() on logoff. Even more, if you close
> down the browser AND logout you still come back and the object is there.
>
> Preston
>
> >>> gareth.evans@msoft.co.uk 10/6/2005 2:04:13 AM >>>
> I take it your using hibernate to load and object from the database and
> prepopulate the form with data?
>
> If so check the hashcode of this object before you populate the
> actionform. It could be that
> hibernate is returning you a cached object rather than a new object each
> time.
>
> If you are storing data within the session, are you calling
> session.invalidate() when the user logs off?
>
> Regards,
>
> Gareth
>
> Preston CRAWFORD wrote:
>
> > This is why I haven't sent code. Because I am narrowing it down already.
> > Same behaviour on WebSphere as of yesterday. Behaviour isn't exhibited
> > when the object in question isn't created as a result of Hibernate, but
> > rather populated manually as you suggested. So we have it narrowed down
> > somewhat. It seems like a Hibernate problem, at this point. That the
> > angle we're working on.
> >
> > Preston
> >
> >
> >>>>szabtam@gmail.com 10/4/2005 5:20:28 PM >>>
> >
> > Well, if you don't send us the code it's hard to help with this one...
> > :-)
> >
> > You should try to narrow down things that could cause the behaviour.
> > For examle:
> > - Try to deploy to another server to be sure that it is not a Tomcat
> > bug.
> > (if you just want to be sure that it's not cause by the 5.0.x bug you
> > can
> > try to
> > deploy to Tomcat 5.5.x )
> > - Try to eliminate Hibernate from the process, I mean populate the
> > object
> > with hard coded data and put that in session.
> > - I don't know how do you populate the objects, if it's a complicated
> > process
> > try to take out some of the functionality temporary until you get to
> > the
> > point
> > when it does work.
> >
> > Tamas
> >
> > On 10/4/05, Preston CRAWFORD <Pr...@state.or.us> wrote:
> >
> >>Well, a lot changed yesterday. I took all forms out of session and
> >
> > it's
> >
> >>still happening. I did much tinkering and discovered that it's any
> >>object in session (so in this case the container object for the
> >>ArrayList that gets set to the form) that's crossing sessions and
> >>STICKING in session as well (as in I'll logout, shut down the
> >
> > browser,
> >
> >>open up the browser and there it is again). So this has me wondering
> >
> > if
> >
> >>it's related to hibernate, which we are using to populate this
> >
> > object.
> >
> >>Preston
> >>
> >>
> >>>>>szabtam@gmail.com 10/4/2005 3:31:29 AM >>>
> >>
> >>On 10/4/05, Preston CRAWFORD <Pr...@state.or.us> wrote:
> >>
> >>>No. What information would be useful and relevant? Struts-config?
> >>
> >>The
> >>
> >>>form bean itself? The action, the JSP? I didn't want to overload
> >
> > the
> >
> >>>list, obviously.
> >>
> >>
> >>
> >>In the following code how do you populate and set the myArrayList
> >>property
> >>of the myFormBean?
> >>If all the myFormBean instances have a reference to the same
> >
> > ArrayList
> >
> >>or
> >>the ArrayLists are not the same
> >>but the items from the ArrayList reference the same objects then all
> >>users
> >>modify and see the same
> >>values...
> >>
> >><c:if test="${! empty myFormBean.myArrayList}">
> >><c:forEach items="${myFormBean.myArrayList}" var="item"
> >>varStatus="loop">
> >><c:out value="${item.memberField}" /><br />
> >></c:forEach>
> >></c:if>
> >>
> >>
> >>Preston
> >>
> >>
> >>Tamas
> >>
> >>
> >
> > ---------------------------------------------------------------------
> >
> >>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >>For additional commands, e-mail: user-help@struts.apache.org
> >>
> >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
> --
> Gareth Evans
>
> MSoft eSolutions Limited
> Technology Centre
> Inward Way
> Rossmore Business Park
> Ellesmere Port
> Cheshire
> CH65 3EN
>
> --
> Tel: +44 (0)870 0100 704
> Fax: +44 (0)870 9010 705
> E-Mail: gareth@msoft.co.uk
> Web: www.msoft.co.uk <http://www.msoft.co.uk>
>
> ----------------------------------------------
> Terms:
> Please note that any prices quoted within this e-mail are subject to VAT.
> All program details and code described in this e-mail are subject to
> copyright (c) of MSoft eSolutions Limited and remain the intellectual
> property of MSoft eSolutions Limited.
> Any proposal or pricing information contained within this e-mail are
> subject to MSoft eSolutions' Terms and Conditions
> ----------------------------------------------
> Disclaimer:
> This message is intended only for use of the addressee. If this message
> was sent to you in error, please notify the sender and delete this
> message. MSoft eSolutions Limited cannot accept responsibility for
> viruses,
> so please scan attachments. Views expressed in this message do not
> necessarily reflect those of MSoft eSolutions Limited who will not
> necessarily be bound by its contents.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


--
Virtually,
Andre Van Klaveren
Architect III, SCP
Global Public Sector
Unisys Corporation