Maybe its not so bad. I don't know exactly how you are doing things, but
from the sounds of it, you could benefit a bit by restructuring along the
lines of front-tier / middle-tier architecture. We do this..even though we
are running all the code on one application server. We have our action
classes create or get a session class (in our case, a session class is
identical to an ejb session..it does the logic, except it runs in the
servlet engine right now until we move to ejb). This way, you can do exactly
as many of us have with Struts (and similar frameworks). Your action classes
have no instance variables. Everything is passed along as parameters (on the
stack) which is faster, less overhead, and thread-safe. You then put your
instance variables into "logic" classes and have your action class call the
session logic class to do the work. You probably already know all this..I am
just reitterating what I thought about when I read your post.

Hope that provides any sort of help. :)


> -----Original Message-----
> From: A mailing list about Java Server Pages specification and reference
> [mailto:[EMAIL PROTECTED]]On Behalf Of Ferghil O'Rourke
> Sent: Thursday, August 24, 2000 2:15 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Model 2 and large applications - and request
> dispatcherthread safety
>
>
> Unfortunately, what this means is that I can get no OOP benefits
> in my action class hierarchy. All the object access code has to
> be repeated in each action class.
> Correct?
>
>
>
> -----Original Message-----
> From: A mailing list about Java Server Pages specification and reference
> [mailto:[EMAIL PROTECTED]]On Behalf Of Vladimir Blagojevic
> Sent: Thursday, August 24, 2000 4:03 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Model 2 and large applications - and request
> dispatcherthread safety
>
>
> <snip>
> I think my problem then is as you stated it. Because I am caching
> the action class instances there is only ever one instance of any
> given action class type. Therefore it is possible that a user
> request could be issued to the controller servlet and be assigned
> an action object instance that is currently being used by another
> user, and therefore it gets a copy of the wrong "master bean."
> </snip>
>
> It does not matter that you have one instance of an action class
> or that it
> is used by another thread (user).  This is the actually way to do
> it.  What
> you have to be carefull about is that you dont have any instance variables
> in your action class. You dont need them and if you do your logic needs to
> be changed!!!
>
> Every user's (thread) call to action's perform method gets
> executed on a new
> method stack of an action class.  There is no concurrency issues.
>
> Hope it helps.
>
> P.S
> See LogonAction.java from struts.
>
>
> Vladimir
>
> ==================================================================
> =========
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
> ==================================================================
> =========
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to