Action method is called multiple times on WebSphere clustered environment
We are running on a wierd scenario. We have a commandlink/button on our page and whenever user clicks on it the action method is being called multiple times. This is happening in clustered environment only.
We are using JSF 1.2 on Websphere portal 6.2. We tried to set enableHighCompatibility
to true
and to call 开发者_如何学JAVAfacesContext.renderResponse()
after the action method is completed, just to make the framework understand that action is done, please render the page.
The above 2 has made maximum to call once, but still we have some scenarios which is calling multiple times the action method in the backing bean.
If this is happening in Websphere
Application Server 7 (WAS7), the reason might be your read/write timeout value. WAS7 has a new admin console parameter included (which is not available in WAS6) under
Application servers -> #cluster name# -> Web server plug-in properties -> Read/Write timeout
This value is defaulted to 60 seconds. So if your transaction takes more than 60 seconds to complete, a second form submission is triggered.
This can be avoided by changing the timeout value to 0 seconds (0 means infinite in WAS). This will ensure your action method is called only once.
精彩评论