SessionStateStoreProviderBase.SetAndReleaseItemExclusive 方法

mac2022-06-30  14

更新当前请求在sesssion-state数据存储中session-item的值,并且清出数据琐. public   abstract   void  SetAndReleaseItemExclusive(     HttpContext context,      string  id,     SessionStateStoreData item,     Object lockId,      bool  newItem )
参数: context:HttpContext; id:类型为String,为当前请求的session 标识. item :SessionStateStoreData对象包括被存储的当前session值. lockId :当前请求的lock标识. newItem :为true 已经识别session item为新item.false识别session item为已经存在的item.
注意:这个SessionStateModule对象在请求结束时调用SetSetAndReleaseItemExclusive方法,在这个调用ReleaseRequesetState事件期间,去插入当前session-item信息进入数据存储或更新已存在的session-item信息,更新过时期的item时,要释放数据lock.只有的session data匹配提给当前应用程序提供的session id 和lockId值才能更新. 如果当前请求的session value没有被修改,这个SetAndReleaseItemExclusive方法不会被调用,而是ReleaseItemExclusive方法被调用. 如果Abandon方法被调用,这个SetAndReleaseItemExclusive方法就不能被调用.而是SessionStateModule 对象调用RemoveItem方法删除session-item.

转载于:https://www.cnblogs.com/worksguo/articles/1117558.html

相关资源:JAVA上百实例源码以及开源项目
最新回复(0)