Webservice asynchronous callback, causing data binding failure, resulting in server problems

  

Last Friday, after unremitting efforts, finally upgraded the site. After the upgrade is completed, it will be more than four in the morning. I thought it would be OK to support it for a few days. I didn't expect the technical director to call this morning, w3p.exe is frequently recycled, and the website visit is very slow. No way, go back to the company to find the reason.
After returning to the company, I finally found out through the single-page stress test with the development manager that it may be due to a problem with the newly added webservice asynchronous callback method. There is often a data binding failure error, and there will be a binding failure in about 3 minutes. Frequent application errors can greatly consume server resources.
After the asynchronous callback method is changed, re-release, and then test. I found that no similar errors occurred, and the page access speed of the website was much faster.
After the analysis of the development manager, the main cause of this problem is caused by the method of asynchronous callback. The specific reasons remain to be continued.

Learn by looking at the relevant references. There is a difference between synchronous and asynchronous: The main thread and the background thread. The main thread is related to the UI and is used to refresh the page and bind the data. The asynchronous call is a background thread, which cannot refresh the page and data source. If you want to do the function of asynchronous binding, you have to control the thread.

The main reason for the above problems we encountered is that

the background thread for the application does not interact directly with the application UI, which is critical. If a background thread tries to modify a control in the application's UI, the control may be in an unknown state. This can cause major problems in the application and is difficult to diagnose. For example, when another thread is transmitting new data to a dynamically generated bitmap, it may not be able to display it. Or, when the dataset is refreshing, components that are bound to the dataset may display conflicting information.

More references can be found at:

http://www.microsoft.com/china/msdn/library/architecture/architecture/architecturetopic/SCArchDeGuide/Chapter6UsingMultThr.mspx?mfr=true



Copyright © Windows knowledge All Rights Reserved