SessionStateStoreProviderBase.SetAndReleaseItemExclusive Method (HttpContext, String, SessionStateStoreData, Object, Boolean)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

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

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

Public MustOverride Sub SetAndReleaseItemExclusive (
	context As HttpContext,
	id As String,
	item As SessionStateStoreData,
	lockId As Object,
	newItem As Boolean


Type: System.Web.HttpContext

The HttpContext for the current request.

Type: System.String

The session identifier for the current request.

Type: System.Web.SessionState.SessionStateStoreData

The SessionStateStoreData object that contains the current session values to be stored.

Type: System.Object

The lock identifier for the current request.

Type: System.Boolean

true to identify the session item as a new item; false to identify the session item as an existing item.

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.

For an example of a session-state store provider implementation, see Implementing a Session-State Store Provider.

.NET Framework
Available since 2.0
Return to top