Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Thread safty for object in session

 
arnold yan
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1055
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please see this thread.
 
Roseanne Zhang
Ranch Hand
Posts: 1953
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic