System.Web.SessionState.SessionStateStoreProviderBase.SetAndReleaseItemExclusive Method

Updates the session-item information in the session-state data store with values from the current request, and clears the lock on the data.

Syntax

public abstract void SetAndReleaseItemExclusive (System.Web.HttpContext context, string id, SessionStateStoreData item, object lockId, bool newItem)

Parameters

context
The System.Web.HttpContext for the current request.
id
The session identifier for the current request.
item
The System.Web.SessionState.SessionStateStoreData object that contains the current session values to be stored.
lockId
The lock identifier for the current request.
newItem
true to identify the session item as a new item; false to identify the session item as an existing item.

Remarks

The System.Web.SessionState.SessionStateModule object calls the SessionStateStoreProviderBase.SetAndReleaseItemExclusive(System.Web.HttpContext, string, SessionStateStoreData, object, bool) method at the end of a request, during the System.Web.HttpApplication.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 System.Web.SessionState.SessionStateStoreProviderBase class overview.

If the session values for the current request have not been modified, the SessionStateStoreProviderBase.SetAndReleaseItemExclusive(System.Web.HttpContext, string, SessionStateStoreData, object, bool) method is not called. Instead, the SessionStateStoreProviderBase.ReleaseItemExclusive(System.Web.HttpContext, string, object) method is called.

If the HttpSessionState.Abandon method has been called, the SessionStateStoreProviderBase.SetAndReleaseItemExclusive(System.Web.HttpContext, string, SessionStateStoreData, object, bool) method is not called. Instead, the System.Web.SessionState.SessionStateModule object calls the SessionStateStoreProviderBase.RemoveItem(System.Web.HttpContext, string, object, SessionStateStoreData) method to delete session-item data from the data source.

Requirements

Namespace: System.Web.SessionState
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0