Hi
Sorry bout that, will try to be more clear.
This is how the action starts:
public class ProjectAction extends GenericAction<Project> implements ModelDriven<Project> {
@Autowired
private WebsiteDAO websiteDAO;
@Autowired
private ProjectManagerDAO projectManagerDAO;
private Project obj;
public
String populate() throws DataAccessException {
String myId = getRequest().getParameter("id");
if (myId != null && !myId.equals("")) {
logger.info("Fetching Project with Id " + id + " of user " + getUser().getId());
obj = (Project) dao.read(Integer.parseInt(myId));
logger.info("After fetch Obj: " + obj + ", Session User Id is " + getUser().getId() + ", obj.user.id is " + obj.getUser().getId());
}
return "form";
}
public Project getObj() {
logger.info("In getObj() Obj: " + obj + ", Session User Id is " + getUser().getId() + ", obj.user.id is " + obj.getUser().getId());
return obj;
}
....
}
In the UI I call populateProject?id=... from 2 different sessions at the same time and then the correct object is being fetched. Then in the
jsp there is a form which has the follwoing line
<s:textfield name="name" key="Name" size="30" value="%{obj.name}"/>
This line is probably call the getObj function which for some reason access the same obj instance (for the different users).
That's the log file:
As you can see - the correct object was fetched and also saved to different obj instance. Problem started in the getObj method - last 2 lines of log.
2011-12-08 15:17:48 ProjectAction [INFO] Fetching Project with Id 498 of user 4
2011-12-08 15:17:48 ProjectAction [INFO] Fetching Project with Id 499 of user 17
2011-12-08 15:17:48 ProjectAction [INFO] After fetch Obj: hbn.Project@6c461f7c, Session User Id is 4, obj.user.id is 4
2011-12-08 15:17:48 ProjectAction [INFO] After fetch Obj: hbn.Project@3fa419d, Session User Id is 17, obj.user.id is 17
2011-12-08 15:17:48 ProjectAction [INFO] In getObj() Obj: hbn.Project@3fa419d, Session User Id is 17, obj.user.id is 17
2011-12-08 15:17:48 ProjectAction [INFO] In getObj() Obj: hbn.Project@3fa419d, Session User Id is 4, obj.user.id is 17
Thanks a lot.