Export (0) Print
Expand All

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.

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

public abstract void SetAndReleaseItemExclusive(
	HttpContext context,
	string id,
	SessionStateStoreData item,
	Object lockId,
	bool newItem
)

Parameters

context
Type: System.Web.HttpContext
The HttpContext for the current request.
id
Type: System.String
The session identifier for the current request.
item
Type: System.Web.SessionState.SessionStateStoreData
The SessionStateStoreData object that contains the current session values to be stored.
lockId
Type: System.Object
The lock identifier for the current request.
newItem
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

Supported in: 4, 3.5, 3.0, 2.0

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Community Additions

ADD
Show:
© 2014 Microsoft