Return-Path: Delivered-To: apmail-jakarta-struts-user-archive@apache.org Received: (qmail 5739 invoked from network); 1 Apr 2002 17:14:14 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 1 Apr 2002 17:14:14 -0000 Received: (qmail 12977 invoked by uid 97); 1 Apr 2002 17:14:02 -0000 Delivered-To: qmlist-jakarta-archive-struts-user@jakarta.apache.org Received: (qmail 12961 invoked by uid 97); 1 Apr 2002 17:14:02 -0000 Mailing-List: contact struts-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list struts-user@jakarta.apache.org Received: (qmail 12950 invoked from network); 1 Apr 2002 17:14:01 -0000 From: theron.kousek@webmd.net Subject: Re: Hi Folks, 2 questions about Actions and their instance To: Struts Users Mailing List Cc: struts-user@jakarta.apache.org X-Mailer: Lotus Notes Release 5.0.1b September 30, 1999 Message-ID: Date: Mon, 1 Apr 2002 10:13:51 -0700 X-Priority: 3 (Normal) X-MIMETrack: Serialize by Router on Gadwall/Nashville/Envoy(Release 5.0.1b|September 30, 1999) at 04/01/2002 11:13:58 AM MIME-Version: 1.0 Content-type: text/plain; charset=us-ascii X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N >> There are 2 different path elements but both refer to the same Action class >> instance... Does this mean 2 static instances of >> BillingActionPreloadForm will exist or will only just 1 exist between the 2 >> different action mappings that link to the same class? > I don't know, but it doesn't matter. You should always assume that > any specific instance of an Action class could potentially serve multiple > threads at once. Or else what's the point of putting your app on the > web? ;-) Reason I brought this up is that I plan to use mysql. Mysql has those AUTO INCREMENT fields and I want to insert a record and immediately call last_index_id() to get the newly inserted row. If I do this is just one and only one action, I may be able to prevent a timing/race condition by which last_index_id() may accidentally be returned from the wrong insert. I definitely want to prevent that from happening. thanks, Theron Jim Crossley cc: 04/01/02 Subject: Re: Hi Folks, 2 questions about Actions and their 09:02 AM instance Please respond to Struts Users Mailing List theron.kousek@webmd.net writes: [...] > So here's my 2 question(s): > > 1. I then assume that "perform()" is synchronized No. If all data objects are local to the perform method, there's no reason for it to be synchronized. If the data objects referred to in perform are shared, then their access should probably be synchronized, but not necessarily. > 2. What about those cases where 2 different action mappings resort to the > same action class? [...] > There are 2 different path elements but both refer to the same Action class > instance... Does this mean 2 static instances of > BillingActionPreloadForm will exist or will only just 1 exist between the 2 > different action mappings that link to the same class? I don't know, but it doesn't matter. You should always assume that any specific instance of an Action class could potentially serve multiple threads at once. Or else what's the point of putting your app on the web? ;-) -- Jim -- To unsubscribe, e-mail: < mailto:struts-user-unsubscribe@jakarta.apache.org> For additional commands, e-mail: < mailto:struts-user-help@jakarta.apache.org> -- To unsubscribe, e-mail: For additional commands, e-mail: