wood burning stoves 2.0*
The moose likes Servlets and the fly likes ask about bean instant per request 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 » Java » Servlets
Bookmark "ask about bean instant per request" Watch "ask about bean instant per request" New topic
Author

ask about bean instant per request

ali mojt
Greenhorn

Joined: Jan 24, 2012
Posts: 2
Hello ,All ,
I have concern about objects name and interesting know about how it is working
Let assume I have a bean of user information AND I am creating new object (new user) from servlet
User user=new User(...)
but object name is the same for per request ,so what will happen If at the same time two object with the same name created is Data overwritten ?
And if other code start to manipulating an object, Is it separating true object
Does exist a method to avoid concurrency?
Many thanks



Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60050
    
  65

It depends where the variable is declared. If it's an instance variable, you've got a world of trouble. If it's a variable within a method, there's no concurrency issues.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ask about bean instant per request
 
Similar Threads
about the bean's scope
One managed session bean for 'each' result window - possible with JSF?
Best Practices for JSF-Spring-Hibernate
Mock exam question
problem while loading the welcome page