SetAndReleaseItemExclusive Method

SessionStateStoreProviderBase::SetAndReleaseItemExclusive Method (HttpContext^, String^, SessionStateStoreData^, Object^, Boolean)

 

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:
virtual void SetAndReleaseItemExclusive(
	HttpContext^ context,
	String^ id,
	SessionStateStoreData^ item,
	Object^ lockId,
	bool newItem
) abstract

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
Available since 2.0
Return to top
Show:
© 2016 Microsoft