亚洲色偷偷一区二区手机在线_国产一卡2卡3卡4卡有限公司_日产精品一至六区_国产成人不卡无码免费视频

星輝互聯(lián)

sql超時(shí)解決方法

來(lái)源:星輝互聯(lián)類型:幫助文件 更新:2009-2-9 點(diǎn)擊:5565

sql超時(shí)解決方法在服務(wù)器端處理一些耗時(shí)很長(zhǎng)的處理的時(shí)候,有時(shí)會(huì)遇到超時(shí)的情況。在無(wú)需發(fā)送響應(yīng)到 IE 的時(shí)候,此問(wèn)題無(wú)關(guān)大雅。但在需要處理完后發(fā)送響應(yīng)的情況下,往往導(dǎo)致瀏覽器超時(shí)無(wú)響應(yīng)。
由于生成統(tǒng)計(jì)表格需要很長(zhǎng)時(shí)間,到下載的時(shí)候?yàn)g覽器已超時(shí)。
解決:在統(tǒng)計(jì)時(shí),同時(shí)打開一個(gè)請(qǐng)求下載的頁(yè)面,這個(gè)頁(yè)面會(huì)定時(shí)刷新,重復(fù)請(qǐng)求。在數(shù)據(jù)準(zhǔn)備好的情況下,進(jìn)行下載;未準(zhǔn)備好的情況下,顯示提示語(yǔ)。
總結(jié):對(duì)于這種長(zhǎng)時(shí)間的會(huì)導(dǎo)致瀏覽器超時(shí)的處理,可以先在服務(wù)器方處理完,然后用異步的方式(瀏覽器重復(fù)詢問(wèn),異步通知等)方式來(lái)取得響應(yīng)。

SQL超時(shí)解決方法
影響服務(wù)器產(chǎn)生超時(shí)的設(shè)置大致有:
1. Server.scrīptTimeout,
2. Connection對(duì)象的CommandTimeOut屬性,
3. Command對(duì)象的CommandTimeOut屬性,
4. IE瀏覽器的設(shè)置.

Server.scrīptTimeout,默認(rèn)值是90秒.
要增大它,在你的asp文件中加一句,如下:
Server.scrīptTimeout=999,
將頁(yè)面超時(shí)設(shè)為999秒.

最初我只設(shè)置Server.scrīptTimeout,
但仍會(huì)出現(xiàn)timeout錯(cuò)誤,無(wú)論它的值設(shè)成都多大.
后在社區(qū)里看到一帖子,提到commandTimeout屬性,
于是查看Option Pack文檔,果然還有其他的timeout.

Connection對(duì)象和Command對(duì)象都有個(gè)CommandTimeOut屬性,
默認(rèn)是30秒,如果你有一個(gè)耗時(shí)的查詢或數(shù)據(jù)處理,
很容易就超時(shí)了.要增大它,也很容易,創(chuàng)建對(duì)象后,
設(shè)置它的屬性,如下:
con.CommandTimeOut = 999,
設(shè)為999秒,其中con是一Connection對(duì)象.
如設(shè)為零,將無(wú)限等待,沒(méi)有這一timeout限制.

Command對(duì)象不會(huì)繼承Connection的這一屬性,
所以對(duì)可能超時(shí)的Command也要單獨(dú)設(shè)置CommandTimeout屬性.

最后IE也有個(gè)超時(shí)設(shè)置,5分鐘從服務(wù)器得不到數(shù)據(jù),也超時(shí).
這種情況可能很少碰到,
但當(dāng)我把一10多萬(wàn)查詢的結(jié)果保存為mdb文件時(shí),
就遇到了.(至于保存的方法,請(qǐng)參看精華區(qū)中的一篇帖子.)

如何設(shè)置瀏覽器超時(shí)時(shí)間
setTimeout('window.close()',100) 其中100為毫秒 。在onload上面加上上面這段代碼,應(yīng)該可以了
在HTML HEAD 中加

900是15分鐘時(shí)間。
TimeOut?OpenForm 是超時(shí)轉(zhuǎn)到的頁(yè)面

鏈接超時(shí)問(wèn)題的瀏覽器端解決方案
How to change the default Keep-Alive Time-Out Value in IE
View products that this article applies to.
Warning If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.

You may have to increase the default time-out value for persistent HTTP connections in Internet Explorer if you are using a Web program that must communicate with Internet Explorer over the same TCP/IP socket after one idle minute. To change the default time-out value for persistent HTTP connections in Internet Explorer, add a DWORD value that is named KeepAliveTimeout to the following registry key, and then set its value data to the time (in milliseconds) that you want Internet Explorer to wait before resetting an idle connection:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\InternetSettings
To do this, follow these steps: 1. Click Start, click Run, type regedit, and then click OK.
2. Locate and then click the following key in the registry:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\InternetSettings
3. On the Edit menu, point to New, and then click DWORD Value.
4. Type KeepAliveTimeout, and then press ENTER.
5. On the Edit menu, click Modify.
6. Type the appropriate time-out value (in milliseconds), and then click OK. For example, to set the time-out value to two minutes, type 120000.
7. Restart Internet Explorer.
If you set the KeepAliveTimeout value to less than 60,000 (one minute), you may have problems communicating with Web servers that require persistent HTTP connections. For example, you may receive a "Page cannot be displayed" error message.

If you must have a KeepAliveTimeout value higher than 120000 (two minutes), you must create an additional registry key and set its value equal to the KeepAliveTimeout value that you want. The additional registry key is ServerInfoTimeout. It is a DWORD with a value (in milliseconds) and in the same location as KeepAliveTimeout.

For example, to use a three-minute KeepAliveTimeout value, you must create the following registry keys:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\InternetSettings

KeepAliveTimeout DWORD value 180000 (in milliseconds)
ServerInfoTimeout DWORD value 180000 (in milliseconds)
By default, HTTP 1.1 is enabled in Internet Explorer except when you establish an HTTP connection through a proxy server. When HTTP 1.1 is enabled, HTTP connections remain open (or persistent) by default until the connection is idle for one minute or until the value that is specified by the KeepAliveTimeout value in the registry is reached. You can modify HTTP 1.1 settings in Internet Explorer by using the Advanced tab in the Internet Options dialog box.

我們很樂(lè)意幫助您!請(qǐng)聯(lián)系在線客服或致電我們。7×24小時(shí)客服熱線: 0833-2438125