You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Daniel Jaffa <ja...@hotmail.com> on 2002/04/04 21:39:40 UTC

ActionBeans

Ok, I just read this in the api

An Action is an adapter between the contents of an incoming HTTP request and the corresponding business logic that should be executed to process this request. The controller (ActionServlet) will select an appropriate Action for each request, create an instance (if necessary), and call the perform method. 

Actions must be programmed in a thread-safe manner, because the controller will share the same instance for multiple simultaneous requests. In this means you should design with the following items in mind: 

  a.. Instance and static variables MUST NOT be used to store information related to the state of a particular request. They MAY be used to share global resources across requests for the same action. 
  b.. Access to other resources (JavaBeans, session variables, etc.) MUST be synchronized if those resources require protection. (Generally, however, resource classes should be designed to provide their own protection where necessary. 

so does this mean that if in my action I have code like this


   ArrayList dataList= new ArrayList();
   dataList = com.cci.dv.beans.loadData.loadDisplayBean(conn, theFormBean, getParamArray());

Will I have data integrity issue because dataList is an Instance variable

Daniel Jaffa