Are httpSessions thread safe?

2003-12-18 Thread Joe Hertz
Not sure how OT this question is. My current plan (unless this is bad for some reason, but if so, Ted H should change his example app :-) is to stash the hibernate Session for a user into his httpSession, and reuse it on each request. A Hibernate Session instance isn't threadsafe. I imagine if

RE: Are httpSessions thread safe?

2003-12-18 Thread Andrew Hill
] Sent: Thursday, 18 December 2003 15:56 To: 'Struts Users Mailing List' Subject: Are httpSessions thread safe? Not sure how OT this question is. My current plan (unless this is bad for some reason, but if so, Ted H should change his example app :-) is to stash the hibernate Session for a user

RE: Are httpSessions thread safe?

2003-12-18 Thread Kris Schneider
); synchronized(unsafeObject) { garthop.nargle(); } -Original Message- From: Joe Hertz [mailto:[EMAIL PROTECTED] Sent: Thursday, 18 December 2003 15:56 To: 'Struts Users Mailing List' Subject: Are httpSessions thread safe? Not sure how OT this question is. My current plan

RE: Are httpSessions thread safe?

2003-12-18 Thread Joe Germuska
At 4:09 PM +0800 12/18/03, Andrew Hill wrote: The sessions essentially just a sort of Map. Access to it may be threadsafe, but the stuff thats in it is another matter entirely. Multiple requests associated with the same session will execute simultaneously. There's nothing in the specs that

Re: Are httpSessions thread safe?

2003-12-18 Thread Max Cooper
PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Wednesday, December 17, 2003 11:56 PM Subject: Are httpSessions thread safe? Not sure how OT this question is. My current plan (unless this is bad for some reason, but if so, Ted H should change his example app :-) is to stash

RE: Are httpSessions thread safe?

2003-12-18 Thread Kris Schneider
Synchronizing on the session object may cause you all sorts of grief...or it may not. It all depends on your container. The spec makes no guarantees about the identity of the object returned by methods like PageContext.getSession or HttpServletRequest.getSession. For example, here's a test JSP:

Re: Are httpSessions thread safe?

2003-12-18 Thread Max Cooper
, December 18, 2003 8:11 AM Subject: RE: Are httpSessions thread safe? Synchronizing on the session object may cause you all sorts of grief...or it may not. It all depends on your container. The spec makes no guarantees about the identity of the object returned by methods like PageContext.getSession

Re: Are httpSessions thread safe?

2003-12-18 Thread Kris Schneider
thread safe? Synchronizing on the session object may cause you all sorts of grief...or it may not. It all depends on your container. The spec makes no guarantees about the identity of the object returned by methods like PageContext.getSession or HttpServletRequest.getSession. For example

RE: Are httpSessions thread safe?

2003-12-18 Thread Joe Hertz
this type of condition I suppose. -J -Original Message- From: Kris Schneider [mailto:[EMAIL PROTECTED] Sent: Thursday, December 18, 2003 11:12 AM To: Struts Users Mailing List Subject: RE: Are httpSessions thread safe? Synchronizing on the session object may cause you all sorts

Re: Are httpSessions thread safe?

2003-12-18 Thread Joe Germuska
At 8:22 AM -0800 12/18/03, Max Cooper wrote: Even though you got a few different objects with those calls, they all represent the same conceptual session underneath. The concept of a session would be worthless otherwise. In other words, if you stash a reference to some object in the session, you

RE: Are httpSessions thread safe?

2003-12-18 Thread Kris Schneider
PROTECTED] Sent: Thursday, December 18, 2003 11:12 AM To: Struts Users Mailing List Subject: RE: Are httpSessions thread safe? Synchronizing on the session object may cause you all sorts of grief...or it may not. It all depends on your container. The spec makes no guarantees

Re: Are httpSessions thread safe?

2003-12-18 Thread David Erickson
AM Subject: RE: Are httpSessions thread safe? The sessions essentially just a sort of Map. Access to it may be threadsafe, but the stuff thats in it is another matter entirely. Multiple requests associated with the same session will execute simultaneously. If you have 1 threads playing

RE: Are httpSessions thread safe?

2003-12-18 Thread Joe Hertz
into a httpSession I suspect would be funny to watch. -Original Message- From: Kris Schneider [mailto:[EMAIL PROTECTED] Sent: Thursday, December 18, 2003 11:45 AM To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: RE: Are httpSessions thread safe? Poked aroung

Re: Are httpSessions thread safe?

2003-12-18 Thread Max Cooper
). And Kris's test shows it probably wouldn't do what you expect it to anyway. -Max - Original Message - From: Kris Schneider [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, December 18, 2003 8:32 AM Subject: Re: Are httpSessions thread safe? The point is about

Re: Are httpSessions thread safe?

2003-12-18 Thread David Erickson
is destroyed. -David - Original Message - From: Joe Hertz [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Thursday, December 18, 2003 10:20 AM Subject: RE: Are httpSessions thread safe? I saw these. I just had this grand idea of minimizing the Hibernate connections

Re: Are httpSessions thread safe?

2003-12-18 Thread Adolfo Miguelez
http://nagoya.apache.org/eyebrowse/[EMAIL PROTECTED]msgId=149353 From: David Erickson [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED],[EMAIL PROTECTED] Subject: Re: Are httpSessions thread safe? Date: Thu, 18 Dec 2003

RE: Are httpSessions thread safe?

2003-12-18 Thread Joe Hertz
this isn't quite worth the effort? No one else seems to mind :) -Joe -Original Message- From: David Erickson [mailto:[EMAIL PROTECTED] Sent: Thursday, December 18, 2003 12:27 PM To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: Re: Are httpSessions thread safe? That second one

Re: Are httpSessions thread safe?

2003-12-18 Thread Max Cooper
fine. -Max - Original Message - From: David Erickson [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, December 18, 2003 9:26 AM Subject: Re: Are httpSessions thread safe? That second one actually works great, 43.html. Since each

Re: Are httpSessions thread safe?

2003-12-18 Thread David Erickson
10:41 AM Subject: RE: Are httpSessions thread safe? I guess creating Hibernate Sessions and Destroying them on every request isn't as bad as I imagine it is? I figured creating the session when the user showed up, destroying it when his httpSession expired, and reconnecting/disconnecting