struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Graham" <>
Subject RE: why only one instance of Action class (Action class thread safety)
Date Wed, 07 May 2003 01:40:16 GMT
Coding thread safe Struts actions is extremely easy, just don't use instance 
variables (there's probably something I forgot but this is the biggest 
pitfall).  If you want to make it even easier, override 
RequestProcessor.processActionCreate to return a new Action instance for 
each request.


>From: Weigen Liang <>
>Reply-To: "Struts Developers List" <>
>CC: "'Struts Developers List'" <>
>Subject: RE: why only one instance of Action class (Action class thread 
>Date: 06 May 2003 21:26:36 -0400
>I disagree with your downplay of thread safety issue. IMHO in a web
>application thread safety is more critical than in many other multi-user
>environments due to the fact that system load is horribly unpredictable
>for web applications. If thread safety is not kept in one's mind ALL THE
>TIME when one designs and codes the web application, I guarantee that
>when the web application has to process hundreds of orders per minute,
>the architects/programmers will be drown in boss and customers' angry
>voice/emails of "why I am get charged for things I did not order". If
>one does not pay enough attention to threading issue during
>design/development, one usually will find it out when the system is
>tested/used under load near the end of the development circle. And that
>"small" bug somewhere will cost one many, many frustrating days to track
>down, since everyone in the team swears that "when I tested it on my
>machine, it worked". Granted for a small and less demanding web
>application, this may not be as prominent as drawing up pretty pages.
>Couple of days ago I brought up the thread safety issue after I was kind
>of surprised by the large numbers of struts users grappling this very
>issue on the struts user mailing list. Since I have to live with
>threading issue all the time, and have to educate my team constantly
>about the issue. I'm in sympathy with them. If a framework can relieve
>some of that burden from its users, it's well worth the effort.
>On Tue, 2003-05-06 at 16:35, Edgar Dollin wrote:
> > Since everyone is weighing in on this, I'll add my two cents.
> >
> > First off, the only 'real' problems people have with struts (excluding
> > bugs) is the mindset of the first application.  The problems that I see
> > are
> >
> > 1) Initial form load
> > 2) Getting used to the tags
> > 3) Getting used to reset / validation / validator
> > 4) Triing to force their business logic into action forms.
> >
> > By then if they have had a problem with thread safety, they have already
> > worked through it during the initial confusion stage anyway.
> >
> > In my opinion, not worth the effort.
> >
>To unsubscribe, e-mail:
>For additional commands, e-mail:

MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.

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

View raw message