aspose file tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Thread safty for object in session Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Reply Bookmark "Thread safty for object in session" Watch "Thread safty for object in session" New topic
Author

Thread safty for object in session

arnold yan
Ranch Hand

Joined: May 31, 2002
Posts: 40
The SCWCD study book said objects in httpsession is not thread safe. The explaination given is that the same user could have multiple browsers open and issues concurrent request. But my understanding was every time you open a new browser, you are assigned to a new session by the server, isn't it? How can you issue concurrent requests within one session?
Can someone give me a better explaination on this?
Thanks.
Arnold
JSCP2
Anthony Villanueva
Ranch Hand

Joined: Mar 22, 2002
Posts: 1055
Please see this thread.
Roseanne Zhang
Ranch Hand

Joined: Nov 14, 2000
Posts: 1953
Different browser windows opened by the same user and belong to the same session is extremely common.
Just use your yahoo account, log in mail.yahoo.com, then if you click the browser icon on your desktop, you get another session, to verify it, you found you need to re-login.
However, if you open a new browser from the already-login browser window File->New->Window, you have 2 browser windows but the same session, to verify it, you found you do not need to re-login. You can do many things with the same or different pages concurrently.
[ August 19, 2002: Message edited by: Roseanne Zhang ]
David Brafford
Ranch Hand

Joined: Feb 11, 2001
Posts: 91
If you open two different browser programs
( ie, Netscape and IE ), you will get two
different sessions.
If you open up two different browser windows
of the same browser, you get one session.
One session, two windows. Now start load
testing. You better have your Session objects
synchronized.
-------------------------------------------
Considering the Certified Java Programmer Exam?
Get JCertify!
http://www.enterprisedeveloper.com/jcertify
Eckel, Baldwin, Green, and more
 
I agree. Here's the link: jrebel
 
subject: Thread safty for object in session
 
Similar Threads
Thread local
Are session attribute not thread safe? p-199 on HFSJ
reg Network adaptor Exception
How HttpSession is not thread safe
Transaction Dermacation