File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "ask about bean instant per request" Watch "ask about bean instant per request" New topic

ask about bean instant per request

ali mojt

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

Joined: Jan 10, 2002
Posts: 63548

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] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: ask about bean instant per request
jQuery in Action, 3rd edition