• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ask about bean instant per request

 
ali mojt
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65128
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic