aspose file tools*
The moose likes Struts and the fly likes Struts 1 ActionClass Instance Variables - Threadsafe? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 1 ActionClass Instance Variables - Threadsafe?" Watch "Struts 1 ActionClass Instance Variables - Threadsafe?" New topic
Author

Struts 1 ActionClass Instance Variables - Threadsafe?

Harish Verma
Ranch Hand

Joined: Feb 27, 2006
Posts: 32
Hello, what happens to instance-level non-static variables declared in a Struts 1 actionclass? For example:

In this case, will the non-static object instances s and someList also be visible to all requests that simultaneously hit someAction? Because someAction is a singleton, my guess is even s and someList should also behave exactly like class-level (static) variables, and therefore should be accessible from simultaneous threads, causing concurrency issues.

Anybody can confirm or refute this? Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts 1 ActionClass Instance Variables - Threadsafe?
 
Similar Threads
Clarification on Sefl test - K&B book
Application Related
instance members, shared?
Static Methods with local variables.. Thread Safe?
ArrayList, contains, objects