在ASP中延迟加载会话变量。净SQL服务器模式

时间:2021-07-22 10:45:53

Would like to know whether the ASP.NET Session Provider in SQL Mode, would optimistically fetch the entire Session State object (i.e all the keys and their values when we request one) or fetch them in a lazy fashion (i.e goes to the Database and fetch only the requested key and corresponding value)?

想知道ASP是否。在SQL模式下,NET会话提供程序会乐观地获取整个会话状态对象(i。e当我们请求一个键时所有的键和它们的值)或以惰性方式获取它们(i)。e去数据库只取所请求的键和相应的值)?

1 个解决方案

#1


3  

I installed the SQL Session State for SQL like this:

我为SQL安装了SQL会话状态如下:

aspnet_regsql.exe -sstype c -ssadd -d mydatabase -U MyUserName -P MyPassword -S xx.xx.xx.xxx

Below is one of the "select" Stored Procedures that gets installed. I tried to make some sense of it.

下面是安装的“选择”存储过程之一。我试着去理解它。

It appears to me that a user's entire session state is serialized and stored in one database record. This would mean the user's entire session state would be loaded in order to access any record.

在我看来,用户的整个会话状态被序列化并存储在一个数据库记录中。这意味着将加载用户的整个会话状态,以便访问任何记录。

I am guessing that it is probably loaded by default during the early stages of the ASP.net page or application life-cycle (perhaps only if the compiler recognized access to Session() in any of the page's code).

我猜测它可能是在ASP.net页面或应用程序生命周期的早期阶段被默认加载的(也许只有当编译器在任何一个页面的代码中确认了对会话()的访问)。

在ASP中延迟加载会话变量。净SQL服务器模式

Here's the table where the session data gets stored, for reference:

这是存储会话数据的表,供参考:

在ASP中延迟加载会话变量。净SQL服务器模式

#1


3  

I installed the SQL Session State for SQL like this:

我为SQL安装了SQL会话状态如下:

aspnet_regsql.exe -sstype c -ssadd -d mydatabase -U MyUserName -P MyPassword -S xx.xx.xx.xxx

Below is one of the "select" Stored Procedures that gets installed. I tried to make some sense of it.

下面是安装的“选择”存储过程之一。我试着去理解它。

It appears to me that a user's entire session state is serialized and stored in one database record. This would mean the user's entire session state would be loaded in order to access any record.

在我看来,用户的整个会话状态被序列化并存储在一个数据库记录中。这意味着将加载用户的整个会话状态,以便访问任何记录。

I am guessing that it is probably loaded by default during the early stages of the ASP.net page or application life-cycle (perhaps only if the compiler recognized access to Session() in any of the page's code).

我猜测它可能是在ASP.net页面或应用程序生命周期的早期阶段被默认加载的(也许只有当编译器在任何一个页面的代码中确认了对会话()的访问)。

在ASP中延迟加载会话变量。净SQL服务器模式

Here's the table where the session data gets stored, for reference:

这是存储会话数据的表,供参考:

在ASP中延迟加载会话变量。净SQL服务器模式