The servlet container is multi-threaded with many threads calling the 1 action's execute method. So, you don't have to worry about pooling actions. If your execute method doesn't use instance variables, then it doesn't need to be synchronized.

Even though there's only 1 instance of each Action, it can be executed simultaneously by many threads.

David



From: "Whitmire, Jeffrey" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Subject: RE: ActionServlet Action caching problem
Date: Tue, 11 Mar 2003 12:52:45 -0500

I'll have to look into it, but it seems to me that if the action is doing a
non-trivial amount of work (which mine is), then if there are multiple
requests, they will get serialized through the single instance of the
action.  It may be that I need to redesign how my action works, but
currently it will submit a job and block until it completes.  If there were
a pool of actions instead of a single one it seems like it would be more
efficient.

Jeff.

-----Original Message-----
From: David Graham [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 11, 2003 12:40 PM
To: [EMAIL PROTECTED]
Subject: RE: ActionServlet Action caching problem


RequestProcessor.processActionCreate() is probably where you could customize


how many Action instances to create.  I'm not sure why you would need
multiple instances but the customization is available.

David



>From: "Whitmire, Jeffrey" <[EMAIL PROTECTED]>
>Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
>Subject: RE: ActionServlet Action caching problem
>Date: Tue, 11 Mar 2003 12:16:33 -0500
>
>Found it. Turns out it wasn't a caching problem at all. I have a threaded
>job manager that was being used by this action class. There was a weird
>exception being thrown that wasn't getting caught which was locking the
>thread. This action was getting reused by Struts, but never did anything
>because it was still blocking on the locked thread.
>
>I've fixed it and learned much, but is there any way to get more control
>over the caching? Do you have to subclass ActionServlet or the
>RequestProcessor to do that? I would think there would be instances where
>you would want a pool of actions instead of only one instance of each.
>Once
>this release gets out I'm going to look at it more, but I was just curious
>about whether anybody has looked into this.
>
>Jeff.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to