>> 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                                                       
                 
                    <jcrossley@if        To:     Struts Users Mailing List             
                 
                    leet.com>            <[EMAIL PROTECTED]>              
                 
                                         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                                                       
                 
                                                                                       
                 
                                                                                       
                 



[EMAIL PROTECTED] 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:[EMAIL PROTECTED]>
For additional commands, e-mail: <
mailto:[EMAIL PROTECTED]>




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

Reply via email to