You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by leonnewsgroup <le...@hotmail.com> on 2005/04/09 21:26:30 UTC

How to make HttpSession thread-safe????

Hi All,

Quick question,
What is the strategies to make HttpSession thread-safe?
Thanks.

Leon

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


RE: How to make HttpSession thread-safe????

Posted by Günther Wieser <gw...@creative-it.com>.
maybe you could tell us more about what you want to achieve, because it
might be the case that you don't have to care that your session is thread
safe...

kr,
guenther 


-----Original Message-----
From: leonnewsgroup [mailto:leonnewsgroup@hotmail.com] 
Sent: Sunday, April 10, 2005 8:08 AM
To: Struts Users Mailing List
Subject: Re: How to make HttpSession thread-safe????

Hi BAL,

Thanks for reply.
Does it mean
synchronized(session) {
    session.setAttribute(..., ....);
    // do whatever else
}
??

Leon

----- Original Message -----
From: "Brian Lee" <br...@hotmail.com>
To: <us...@struts.apache.org>
Sent: Saturday, April 09, 2005 4:06 PM
Subject: RE: How to make HttpSession thread-safe????


> You can put an object in session and lock on it using synchronized. But
this
> won't work over a cluster.
>
> BAL
>
> >From: "leonnewsgroup" <le...@hotmail.com>
> >To: "Struts Users Mailing List" <us...@struts.apache.org>
> >Subject: How to make HttpSession thread-safe????
> >Date: Sat, 9 Apr 2005 15:26:30 -0400
> >
> >Hi All,
> >
> >Quick question,
> >What is the strategies to make HttpSession thread-safe?
> >Thanks.
> >
> >Leon
> >
> >---------------------------------------------------------------------
> >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
>
>

---------------------------------------------------------------------
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: How to make HttpSession thread-safe????

Posted by leonnewsgroup <le...@hotmail.com>.
Hi BAL,

Thanks for reply.
Does it mean
synchronized(session) {
    session.setAttribute(..., ....);
    // do whatever else
}
??

Leon

----- Original Message ----- 
From: "Brian Lee" <br...@hotmail.com>
To: <us...@struts.apache.org>
Sent: Saturday, April 09, 2005 4:06 PM
Subject: RE: How to make HttpSession thread-safe????


> You can put an object in session and lock on it using synchronized. But
this
> won't work over a cluster.
>
> BAL
>
> >From: "leonnewsgroup" <le...@hotmail.com>
> >To: "Struts Users Mailing List" <us...@struts.apache.org>
> >Subject: How to make HttpSession thread-safe????
> >Date: Sat, 9 Apr 2005 15:26:30 -0400
> >
> >Hi All,
> >
> >Quick question,
> >What is the strategies to make HttpSession thread-safe?
> >Thanks.
> >
> >Leon
> >
> >---------------------------------------------------------------------
> >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
>
>

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


RE: How to make HttpSession thread-safe????

Posted by Brian Lee <br...@hotmail.com>.
You can put an object in session and lock on it using synchronized. But this 
won't work over a cluster.

BAL

>From: "leonnewsgroup" <le...@hotmail.com>
>To: "Struts Users Mailing List" <us...@struts.apache.org>
>Subject: How to make HttpSession thread-safe????
>Date: Sat, 9 Apr 2005 15:26:30 -0400
>
>Hi All,
>
>Quick question,
>What is the strategies to make HttpSession thread-safe?
>Thanks.
>
>Leon
>
>---------------------------------------------------------------------
>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