Thanks for the help, Meg.  My problem comes up when the second request
comes in (before the first has completed).

For example, Browser A completes an HTML form (which is in a JSP, called by
the main servlet with callPage) and presses SUBMIT.  That causes the
service method to be called in the servlet referenced in the <FORM> tag
(which is the main servlet).  This service method gets the sessionid of the
request, and then gets the business object and the parameter values out of
the session,  and invokes other methods to do the sets on this business
object, ultimately storing data into the database files.

While this is happening, a second request comes in (from Browser B).  It
gets it's session id, then gets the business object and parameter values
out of the session.  These objects overwrite the objects from the first
request.  The data that the first request stores winds up being the data
from the second request.

I know I've got to be missing something obvious here, but I just can't find
it!

I'm using IBM WebSphere 2.02.

Again, thanks very much for your help!
Phil

At 06:09 PM 1/17/00 , you wrote:
>Hi,
>
>I have been able to utilize the HttpSession object
>successfully by passing the servlet engine's session ID
>around in the Http request.  This is not a totally
>generic solution, since different servlet engines have
>different names for their session ID and you need to
>find out what name your servlet engine uses. The
>servlet engine sees the session ID in the request and
>then when you ask for the session object, returns the
>correct one.  You don't need to use synchronized methods
>to do this.
>
>So, my JSP/servlet engine is JRun and the session ID for JRun
>is called "jrunsessionid".  You get the ID by calling session.getId()
>and then pass it in subsequent requests with the name
>"jrunsessionid".  Now, things which one page "putValue" into my
>session object I can retrieve with "getValue" in my other pages.
>
>I hope this helps,
>Meg
>
>---
>Meg Sharkey             [EMAIL PROTECTED]
>Engineer                (650) 298-3857
>OnLink Technologies     www.onlink.com
>
>
>
>
>-----Original Message-----
>From: Phil Groschwitz [mailto:[EMAIL PROTECTED]]
>Sent: Monday, January 17, 2000 12:28 PM
>To: [EMAIL PROTECTED]
>Subject: Re: Is Global Session Possible?
>
>
>Eric,
>
>I hope you can shed some light here!  I understand how to use the
>HttpSession object to maintain state.  What I haven't been able to figure
>out is how to maintain integrity.  For example, in a http intranet
>application using Java, Java Servlets, and JSP's, (and DB2/400), how do you
>maintain session integrity?  I have found the only way is to use
>synchronized, but that slows down the app too much because virtually every
>method changes the database objects.  All the updating for a given request
>must complete, and the object stored in the session, before the next
>request can start.
>
>I'm missing something basic here.  I hope you can help!
>
>Thanks in advance,
>Phil
>
>At 10:30 AM 1/17/00 , you wrote:
> >Nikolas,
> >I don't believe that what you are asking is possible. In particular, there
> >is no way to keep
> >the same session across two different browsers without requiring log-in,
> >since cookies
> >for both browsers are stored separately and IP addresses are not unique.
> >
> >In terms of spawning a new browser window, Netscape keeps the same session,
> >so you can't
> >invalidate one window in favor of the one "on top". In IE, there is
> >actually a setting that allows
> >you to choose whether or not a new window launches "in a separate process".
> >Just check your
> >Internet options -> Advanced tab -> Browsing ->
> >   Browse in a new process (IE4 ) or Launch browser windows in a separate
> >process (IE5)
> >
> >Note that this setting is, by default, unchecked, so that most users should
> >retain session across
> >browser windows (the way Netscape does).
> >
> >I wouldn't worry too much about people using two different browsers for the
> >same application -
> >if people do this, they will probably be sophisticated enough to understand
> >that the two sessions
> >will be different. Amazon.com and many other Web sites work this way
> >(different session under a
> >different browser), so I wouldn't make this a technical or business
> >requirement. This is something
> >you should be able to explain to your colleagues.
> >
> >Same with browser windows - nobody expects when they open a new window to
> >have the previous
> >window go dead. In fact, I would see this as a bug.
> >
> >Asking for a unique ID for a GIVEN USER on a public Web application is not
> >out of the question, though;
> >many Web sites have this as an OPTION for the user, if he/she would like to
> >take advantage of these
> >session features (which you can promote on your site, as many other sites
> >do). Simply have them
> >choose a name and password, and kindly ask them to log in when they return
> >(you can even
> >remember their password via a cookie on the machine if they really want).
> >By doing this,
> >you are providing many features for little work on the user's part - and
> >they can use ANY
> >browser an ANY machine. And these days, people use more than one computer
> >(at home,
> >at work, Palm VII, etc), which makes you wonder about the usefulness of
> >that PIII chip thingy.
> >Also keep in mind that the number of people in this situation will only
> >increase over time.
> >
> >Just some thoughts.
> >
> >Eric M. Andersen
> >I/T Specialist
> >IBM Global Services
> >Tel: (781) 895-2637,   Fax : (781) 895-2843, t/line : 362-2637
> >Internet ID:  [EMAIL PROTECTED]
> >Lotus Notes ID: Eric M Andersen/Waltham/IBM
> >
> >===========================================================================
> >To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> >JSP-INTEREST".
> >FAQs on JSP can be found at:
> >  http://java.sun.com/products/jsp/faq.html
> >  http://www.esperanto.org.nz/jsp/jspfaq.html
>
>www.groschwitz.com
>
>===========================================================================
>To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
>JSP-INTEREST".
>FAQs on JSP can be found at:
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to