struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Struts Newsgroup (@Basebeans.com) <str...@basebeans.com>
Subject Re: Hi Folks, 2 questions about Actions and their instance
Date Mon, 01 Apr 2002 18:40:03 GMT
Subject: Re: Hi Folks, 2 questions about Actions and their instance
From: Vic Cekvenich <vic@basebeans.com>
 ===
Imeditely calling is not good enough. You must use a JDBC driver 
specific call that returns the last "affected rows" ID.
This gives you the new PK.
Vic

theron.kousek@webmd.net wrote:

>>>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>            <struts-user@jakarta.apache.org>  
                            
>                                          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:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>
> 


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message