dcsimg
Problem with hitting the same action at the same time, beans being passed to the page are being removed
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Aaron_Cheeseman
Posted On:   Wednesday, March 19, 2003 10:20 PM

Hi, I currently have a webapp that has several actions that are hit by the user. Now with a single user hitting these actions is fine, and the majority of the time multiple users hitting the actions are also fine. However occasionally when two users are hitting the same action one of the users bombs out with an HTTP:500 error saying 'Cannot find bean clientBean in any scope'. I've been through and debugged the beans being added to the page and all of the beans are not null when they're added to the request scope. Its like on completing the rendering of the page the beans are being wiped for both users and not seperately? Any help would be greatly appreciated    More>>

Hi,
I currently have a webapp that has several actions that are hit by the user. Now with a single user hitting these actions is fine, and the majority of the time multiple users hitting the actions are also fine.


However occasionally when two users are hitting the same action one of the users bombs out with an HTTP:500 error saying 'Cannot find bean clientBean in any scope'.


I've been through and debugged the beans being added to the page and all of the beans are not null when they're added to the request scope.


Its like on completing the rendering of the page the beans are being wiped for both users and not seperately?


Any help would be greatly appreciated


Cheers in advance

Aaron

   <<Less

Re: Problem with hitting the same action at the same time, beans being passed to the page are being removed

Posted By:   Aaron_Cheeseman  
Posted On:   Thursday, March 20, 2003 02:46 PM

For those who are interested, i've been through my code surrounding my actions, and it appears that I was using class variables instead of local variables for a few things in the action, this of course led to some of the members being overwritten by subsequent requests.


For those who don't know or are interested, struts reuses instances of actions after they are initially instantiated so when you use member variables, you are of course going to have problems when one thread nukes / changes another threads variables before it has had the chance to use them ;P


cheers

--Aaron

About | Sitemap | Contact