IIS闲置超时

Oralce.DataAccess.dll使用的是32位版本,需要在连接池-高级设置-启动32位应用程序,改为true。



有没有好的办法,让一些资源不被回收? 比如spring.net那些object。再探!



后来发现,闲置超时引发Application_End的时候,HttpApplication中的变量activeUrl的数值还存在,

但手动回收或停止连接池、网站的时候,activeUrl 就为 null了。

所以就很简单的如下处理了一下儿,IIS7下实验通过。


注意:activeUrl指向的页面,必须有spring.net的调用,以此保证spring的相关objects不被回收。


public class Global : System.Web.HttpApplication

{

        string activeUrl = System.Configuration.ConfigurationSettings.AppSettings["MobileWeb.ActiveUrl"];

 

void Application_End(object sender, EventArgs e)

        {

            if (activeUrl != null)

            {

                new System.Net.WebClient().DownloadData(activeUrl);

            }

        }

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/11265.html