commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <>
Subject Re: [workflow] comparing web based and message based (was Re: Workflow)
Date Thu, 15 Nov 2001 08:21:50 GMT
----- Original Message -----
From: "Craig R. McClanahan" <>
> See intermixed (quite a ways down).
> On Wed, 14 Nov 2001, James Strachan wrote:
> > Date: Wed, 14 Nov 2001 18:10:47 -0000
> > From: James Strachan <>
> >
> > > From: "Craig R. McClanahan" <>
> > >
[big snip]

> > > Given this, the application programming model should not have to pay a
> > > whole lot of attention to which server its running on.  (Of course,
> > > have to also obey the restrictions on Serializable session attributes,
> > > beyond that the application's view is very similar to a
> > > environment.)
> >
> > Agreed. Though I've also experienced multiple concurrent requests for
> > same HttpSession before in the past - caused by a browser with several
> > windows open doing seperate requests - I can't remember off the top of
> > head if it was Netscape or IE.
> That's real easy to have happen, even in a non-distributed environment.
> Most browsers are configured by default to issue multiple simultaneous
> requests if it makes sense (and it will make sense if you're using frames
> or image URLs in your pages; that's why you sometimes see multiple images
> being downloaded at the same time).  If you're using sessions, all of
> those requests will be for the same session ID, and they will be processed
> by your container simultaneously (on different threads).
> The web application developer is *always* responsible for dealing with
> multiple simultaneous requests to the same session.  You deal with that by
> appropriate "synchronized" locks to prevent problems with your session
> attributes.  The reason for the servlet spec restriction on distributed
> environments is so that the application developer does not need to figure
> out problems like how to synchronize a HashMap across JVMs :-).


For some reason when you said 'very similar to a non-distributed
environment' I thought of 'single threaded' for some wierd reason.

I guess a servlet developers environment is similar to a non distributed one
as you suggest, but it is a multi threaded one with resepct to session state
(and application) state.  I think alot of developers don't realize this.

e.g. In the early days of getting to grips with the whole J2EE platform it
seems natural to use the HttpSession to store a reference to a stateful
session bean - which could break as there is a chance that it could be used
by more than one thread at the same time. So either some locking mechansim
should be used or the HttpSession should store a pool of references to the
EJB rather than an individual EJB reference.


Do You Yahoo!?
Get your free address at

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message