【转】关于arcgis server ADF的几种超时
我發現下面的提示英文的很不爽:
session has timed out from extended inactivity
a new session must be started to use this application by closing this brower and reopening
于是搜了下
知道了arcgis server ADF的超時問題
ADF的超時分為三種
■一種是adf控件的超時,純客戶端的超時,而且只和adf控件的js有關系
也就是如果你的adf控件在客戶端沒有被操作達到一定時間后的timeout,與adf控件無關的其他操作不受影響,而且不經過adf的js與server通訊也不受影響。
結果就是提示我上面列出的內容,這種超時是在aspnet_client\ESRI\WebADF\JavaScript\display_common.js 第990行設定的
var maximumLapseTime = 10; // Change this value to session timeout in minutes
提示信息也在這個js文件中,showLapseAlert() 這個函數負責
這種超時應該小于等于ASP.NET 自身的超時,顯然,要是大于了,server端都超時了,client端還怎么混啊。
如果想修改這種超時,只需要重寫這兩個地方,但是要在display_common.js 加載之后的地方再重寫一遍,比如寫在<html>標簽之后
重寫了showLapseAlert()就能不提示那一堆鳥語了
如果想禁用這種超時,?
var maximumLapseTime = Infinity;
■一種是ASP.NET 自身的超時 ,就是我們平常接觸的asp的20分鐘session超時,不介紹了
在web.config中加個<sessionState timeout="10"/>就可以改了
■一種是數據源超時,純服務器端的
在arcgis server 設置中使用非池化的時候,一個asp.net的session在創建的時候arcgis server就會創建 server context,這種超時就是server context的壽命,數據源超時應該和asp.net的session一樣,否則可能在一個session期間server context就會死掉,還得重新創建
怎么修改呢?我不會,反正是在地圖服務器那里設置
非池化模式下的超時問題。。我也沒看懂
以下是英文原版
------------------------------------------------------------------------------------------------------------------
Timeout settings in the Web ADF
There are three timeouts to consider when using a Web ADF application: Web ADF timeout (client-tier), ASP.NET session timeout (Web-tier), data source timeout (server-tier).?? The relationships between the different timeout values and where they apply is important to understand.??
The Web ADF timeout is only used by the browser.? The ASP.NET session is not aware of the client timeout, however both the client and Web-tier timeouts are designed to work together.? The Web ADF timeout gives you the ability to use browser logic to provide the end-user with information about timeout details, without requiring an additional request to the Web server.? This is important in an asynchronous communication environment (such as AJAX-enabled Web ADF controls) where you want to intercept a callback to a Web application session that no longer exists.? In general, the Web ADF timeout is designed for the end user while the ASP.NET session timeout is necessary from a Web application perspective to dispose of resources.? With this in mind, the Web ADF timeout can be the same or less than the ASP.NET session timeout.? In most cases, they should be the same.?
The data source timeout is usually necessary to control erroneous requests to services to make sure system resources are available and utilized appropriately.?? Timeout values are relative and depend on service requirements.? Since most requests to services in the Web ADF are stateless, ASP.NET session timeout does not play a part.? However, if a connection to a service is persistent across requests, the relationship between ASP.NET session timeouts and data source timeouts may need to be considered.? In the case of ArcGIS Server local connections to non-pooled services, server context can be created once at the beginning of a session and maintained (persisted) for the duration of the session.? If the "maximum use" timeout on the ArcGIS Server service is less than the session timeout, it is possible that server context will need to be recreated.????????
1) The Web ADF timeout is set in the display_common.js file on the following line:
var maximumLapseTime = 10;
The timeout value is in minutes. Note that by default, the display_common.js file is embedded as a Web resource in Web ADF controls and streamed to a browser at runtime.? The default value is set to 10 minutes.? In order to change this value for a Web ADF application, you need to change the maximumLapseTime variable after the display_common.js file is loaded.?? In the Web page add the following script tag and variable setting in the form that contains Web ADF controls:?
<script language="javascript" type="text/javascript">
? var maximumLapseTime = 20;
</script>
At runtime, the display_common.js content will be loaded inline at the beginning of the form.? Adding this script tag will override the maximumLapseTime variable setting in display_common.js.?? To disable the Web ADF timeout, set the maximumLapseTime variable to Infinity:
<script language="javascript" type="text/javascript">
? var maximumLapseTime = Infinity;
</script>
To change the message returned after the timeout is reached "override" the showLapseAlert() JavaScript function. "Override" in this sense means define the showLapseAlert() JavaScript function after the function in display_common.js.? For example, include this at the end of the aspx page:
<script language="javascript" type="text/javascript">
? function showLapseAlert()
? {
??? alert("Application has timed out. Reloading.");
??? window.location.reload();
? }
</script>
Note that this also triggers a page reload via JavaScript.
2) The ASP.NET session timeout can be set in the web.config file. By default, it is set to 20 minutes. To change the timeout for a Web application, add the following to your web.config, within <system.web>:
<sessionState timeout="10"/>
3) A data source timeout is managed by the data source provider. For example, ArcIMS administrators have the ability to change the time alloted for a spatial server to process a request.? ArcGIS Server administrators can change the usage time alloted for an individual service.? Administration documentation for specific data sources may provide additional details on timeout management at this level.
轉載于:https://www.cnblogs.com/aooyu/archive/2009/12/11/1621767.html
總結
以上是生活随笔為你收集整理的【转】关于arcgis server ADF的几种超时的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 如何读取FoxPro(dbf)打删除标记
- 下一篇: windchill开发之创建对象