Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Data overwrite for Concurrent Request in ActionForm

 
Ghulam Rashid
Ranch Hand
Posts: 278
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have problem with data overwrite when concurrent request comes in. Below is the flow.
JSP -> ActionForm -> Action Class -> Bean Class for Business/Data

When two request comes from 2 different browsers together, one for requesting Employee data for EMP Number 100 and other for Emp Number 200. so, on both the browser window data for Emp Number 200 is displyed. That means it displays the data for the last request always, overwriting old request.

Few Things.

1. In JSP, we are iterating through using <logic:iterate> and then <bean:write formProperty>.
2. Setter method of the Form is populated in the bean class using -
PropertyUtils.setProperty(OutputForm, aColNames[i].toString(), RowContentString);
3. We are not using any instance variable in bean class for populating form property using setter method.

Dont know why ActionForm is not sustaining old data.

Any pointer will be of great help.


Thanks
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I doubt this is a problem with your ActionForm. Struts provides a separate instance of this class for each individual user.

I'd check your action class. This class is multi-threaded and must not have instance variables that are not common to all users.

If you are sure the execute() method of your action class is thread-safe and are still getting the problem, post your code, and we'll see if we can help you solve the problem.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic