为什么心不是会话超时时,设置为SqlServer的工作吗? [英] Why isnt the session timeout working when set to SqlServer?

查看:389
本文介绍了为什么心不是会话超时时,设置为SqlServer的工作吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我也行:

<sessionState mode="SQLServer" sqlConnectionString="Data Source=localhost;User Id=sa;Password=test;" timeout="1" />

其中存储在SQL状态服务器的会话。然而,它并没有在一分钟后正常超时。

Which stores the session in a sql state server. However it does not timeout properly after one minute.

在我行更改为使用是InProc模式:

When I change the line to use InProc mode:

<sessionState mode="InProc" sqlConnectionString="Data Source=localhost;User Id=sa;Password=test;" timeout="1" />

它确实超时后一分钟。

It does timeout after one minute.

任何想法,为什么发生这种情况?如何使用SqlServer时,我得到它超时?

Any ideas why this is happening? How can I get it to timeout when using SqlServer?

推荐答案

如果您正在使用SQL Server防爆preSS,这是因为没有执行DeleteExpiredSessions程序SQL Server代理。

If you're using SQL Server Express, it's because there is no SQL Server Agent to execute the DeleteExpiredSessions procedure.

下面是一个可能的解决方法的问题:

Here is a possible workaround to the problem:

在该更新会话存储过程中,我加入SQL
  从DeleteExpiredSessions程序来更新会话存储
  程序(我不记得名字了),所以它会检查旧的会话,
  删除旧会话,然后更新当前会话。该
  储存程序更新每个会话中运行单击无论如何,
  所以我加了两行,本次会议之前删除旧的会话
  被更新。这似乎很好地工作。

In the stored procedure that updates the session, I have added SQL from the DeleteExpiredSessions procedure to the update session stored procedure (I can't remember the name) so it checks for old sessions, deletes the old session, and then updates the current sessions. The stored procedure that updates the session runs on every click anyway, so I added two more lines that remove old sessions before the session is updated. This seems to work fine.

这篇关于为什么心不是会话超时时,设置为SqlServer的工作吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆