• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Data overwrite for Concurrent Request in ActionForm

 
Ranch Hand
Posts: 278
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic