Updates the session-item information in the session-state data store with values from the current request, and clears the lock on the data.
- 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.
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.