This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes Struts and Synchronized Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts and Synchronized" Watch "Struts and Synchronized" New topic
Author

Struts and Synchronized

Hari babu
Ranch Hand

Joined: Jun 25, 2001
Posts: 208
Hi all,
In my web application, i use Struts talking to EJB layer. When iam accessing a remote interface in my struts layer (in "Action" class ) do i need to make the remote as Synchronized? Because i have read that Struts allows multiple thread access to a single servlet.Any help in this regard is appreciated.
Thanks in advance
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4442
    
    5

Same general considerations apply in Struts: if you are accessing using an instance variable (which you really shouldn't have in an Action), you need to synchronize. If you are using a local variable, there is no need to synchronize as each thread will have its own set of local variables.


Junilu - [How to Ask Questions] [How to Answer Questions]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Struts and Synchronized
 
Similar Threads
B&S: How to make Booking method atomic?
Syncronised EJB access
EJB Or Spring To Separate Web Tier And Business Tier
passing exeception
[Session Fa�ade/POJO Fa�ade] VS [Application Service]