Ext. ajax. timeout

Source: Internet
Author: User

Ext. ajax. timeout

The company has a small product that uses ext's ajax function. Later, when the data volume is large, query timeout is always reported. After analysis, it is caused by the default timeout setting. Later, it adds a sentence to the jsp page.

 

Ext. Ajax. timeout = 900000; (timeout is 15 minutes, in milliseconds. The default value is 30 seconds)

Done. References

The use of Ext for R & D will inevitably involve the data communication problem between the front-end and the back-end, that is, the data is usually obtained from the back-end; there will be a problem of time in this process, that is, it is impossible for the front-end to wait there. I don't expect such a problem at ordinary times, but the recent projects only suffer from thinking and the amount of data is too large, the total number of data records for a single query takes more than one minute (the total number of data records in the table is more than 60 million). The backend does not finish the query, and the front-end prompts that the query times out. After checking a lot of data, the process is completed;
Method:
Add a sentence to the page:
Ext. Ajax. timeout = 900000; (timeout is 15 minutes, in milliseconds. The default value is 30 seconds)
Ext. Ajax. request example
 

Ext. messageBox. confirm ('prompt information', info, function (btn) {if (btn = 'yes') {Ext. ajax. request ({url :'.. /delCompanyById. do ', params: {companyId: sendCompanyId}, success: function (response, options) {// Ext. util. JSON. decode (response. responseText); var jsonObj = Ext. util. JSON. decode (response. responseText); alert ("result is -----" + jsonObj. message); companyStore. load () ;}, failure: function (response, ooptions) {// Ext. util. JSON. decode (response. responseText); var jsonObj = Ext. util. JSON. decode (response. responseText); alert ("result is -----" + jsonObj. message );}});

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.