SessionStateStoreProviderBase.SetAndReleaseItemExclusive Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Updates the session-item information in the session-state data store with values from the current request, and clears the lock on the data.
public:
abstract void SetAndReleaseItemExclusive(System::Web::HttpContext ^ context, System::String ^ id, System::Web::SessionState::SessionStateStoreData ^ item, System::Object ^ lockId, bool newItem);
public abstract void SetAndReleaseItemExclusive (System.Web.HttpContext context, string id, System.Web.SessionState.SessionStateStoreData item, object lockId, bool newItem);
abstract member SetAndReleaseItemExclusive : System.Web.HttpContext * string * System.Web.SessionState.SessionStateStoreData * obj * bool -> unit
Public MustOverride Sub SetAndReleaseItemExclusive (context As HttpContext, id As String, item As SessionStateStoreData, lockId As Object, newItem As Boolean)
Parameters
- context
- HttpContext
The HttpContext for the current request.
- id
- String
The session identifier for the current request.
The SessionStateStoreData object that contains the current session values to be stored.
- lockId
- Object
The lock identifier for the current request.
- newItem
- Boolean
true
to identify the session item as a new item; false
to identify the session item as an existing item.
Examples
For an example of a session-state store provider implementation, see Implementing a Session-State Store Provider.
Remarks
The SessionStateModule object calls the SetAndReleaseItemExclusive method at the end of a request, during the ReleaseRequestState event, to insert current session-item information into the data store or update existing session-item information in the data store with current values, to update the expiration time on the item, and to release the lock on the data. Only session data for the current application that matches the supplied session id
and lockId
values is updated. For more information about locking, see "Locking Session Store Data" in the SessionStateStoreProviderBase class overview.
If the session values for the current request have not been modified, the SetAndReleaseItemExclusive method is not called. Instead, the ReleaseItemExclusive method is called.
If the Abandon method has been called, the SetAndReleaseItemExclusive method is not called. Instead, the SessionStateModule object calls the RemoveItem method to delete session-item data from the data source.