• Post Reply Bookmark Topic Watch Topic
  • New Topic

Struts and Synchronized

 
Hari babu
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Posts: 10408
125
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!