Share via


Session Class

Represents a row in sys.server_event_sessions and includes data from sys.dm_xe_sessions if running.

Inheritance Hierarchy

System.Object
  Microsoft.SqlServer.Management.Sdk.Sfc.SfcInstance
    Microsoft.SqlServer.Management.XEvent.Session

Namespace:  Microsoft.SqlServer.Management.XEvent
Assembly:  Microsoft.SqlServer.Management.XEvent (in Microsoft.SqlServer.Management.XEvent.dll)

Syntax

'Declaration
Public NotInheritable Class Session _
    Inherits SfcInstance _
    Implements ISfcCreatable, ICreatable, ISfcAlterable, IAlterable,  _
    ISfcDroppable, IDroppable, ISfcValidate, ISfcDiscoverObject
'Usage
Dim instance As Session
public sealed class Session : SfcInstance, 
    ISfcCreatable, ICreatable, ISfcAlterable, IAlterable, ISfcDroppable, 
    IDroppable, ISfcValidate, ISfcDiscoverObject
public ref class Session sealed : public SfcInstance, 
    ISfcCreatable, ICreatable, ISfcAlterable, IAlterable, ISfcDroppable, 
    IDroppable, ISfcValidate, ISfcDiscoverObject
[<SealedAttribute>]
type Session =  
    class 
        inherit SfcInstance 
        interface ISfcCreatable 
        interface ICreatable 
        interface ISfcAlterable 
        interface IAlterable 
        interface ISfcDroppable 
        interface IDroppable 
        interface ISfcValidate 
        interface ISfcDiscoverObject 
    end
public final class Session extends SfcInstance implements ISfcCreatable, ICreatable, ISfcAlterable, IAlterable, ISfcDroppable, IDroppable, ISfcValidate, ISfcDiscoverObject

The Session type exposes the following members.

Constructors

  Name Description
Public method Session() Initializes a new instance of Session class.
Public method Session(XEStore, String) Initializes a new instance of Session class.

Top

Properties

  Name Description
Protected property AbstractIdentityKey Do not reference this member directly in your code. It supports the SQL Server infrastructure. (Inherited from SfcInstance.)
Public property AutoStart Gets or sets a value indicating whether the AutoStart object is active or not.
Public property EventRetentionMode Gets or sets the EventRetentionMode object.
Public property Events Gets the EventCollection of the session.
Public property ID Gets the ID object.
Public property IdentityKey Gets the identity key of the session.
Public property IsRunning Gets a value indicating whether this session is running.
Public property MaxDispatchLatency Gets or sets the maximum dispatch latency in seconds.
Public property MaxEventSize Gets or sets the size in KB of the maximum event for the session.
Public property MaxMemory Gets or sets the maximum memory in KB of the session.
Public property MemoryPartitionMode Gets or sets the memory partition mode from an enumeration with options for perNode, perCpu, or none.
Public property Metadata Returns metadata about the instance and its domain. (Inherited from SfcInstance.)
Public property Name Gets the name of the Session object.
Public property Parent Gets or sets the parent XEStore object.
Public property Properties Returns a collection instance properties. (Inherited from SfcInstance.)
Public property StartTime Gets the start time.
Public property State Gets the state of the object used in Alter function in session.
Public property Targets Gets the TargetCollection.
Public property TrackCausality Gets or sets a Boolean value indicating whether the TrackCausality object is activated.
Public property Urn Returns the uniform resource name of the SfcInstance object. (Inherited from SfcInstance.)

Top

Methods

  Name Description
Public method AddEvent(String) Adds a new Event object to the session from fully qualified event name.
Public method AddEvent(EventInfo) Adds a new Event object to the session.
Public method AddTarget(String) Adds a new Target object to the session.
Public method AddTarget(TargetInfo) Adds a new Target object to the session.
Public method Alter Alters the Session object on the server.
Public method Create Creates the Session object on the server.
Protected method CreateIdentityKey Do not reference this member directly in your code. It supports the SQL Server infrastructure. (Inherited from SfcInstance.)
Public method Discover Do not reference this member directly in your code. It supports the SQL Server infrastructure. (Inherited from SfcInstance.)
Public method Drop Drops the Session object on the server.
Public method Equals (Inherited from Object.)
Protected method GetChildCollection Do not reference this member directly in your code. It supports the SQL Server infrastructure. (Inherited from SfcInstance.)
Public method GetDomain Do not reference this member directly in your code. It supports the SQL Server infrastructure. (Inherited from SfcInstance.)
Public method GetHashCode (Inherited from Object.)
Public methodStatic member GetObjectFactory Gets the SQL Foundation Class object factory.
Public method GetPropertySet Returns the set of properties for the SfcInstance object. (Inherited from SfcInstance.)
Public method GetType (Inherited from Object.)
Protected method GetTypeMetadataImpl Indicates the domains that override by returning the right TypeMetadata class directly. Do not reference this member directly in your code. It supports the SQL Server infrastructure. (Inherited from SfcInstance.)
Protected method InitializeUIPropertyState Do not reference this member directly in your code. It supports the SQL Server infrastructure. (Inherited from SfcInstance.)
Protected method OnPropertyMetadataChanges Invoked whenever the effective value of any SfcInstance metadata is updated. (Inherited from SfcInstance.)
Protected method OnPropertyValueChanges Invoked whenever the effective value of any SfcInstance property is updated. (Inherited from SfcInstance.)
Public method Refresh Refreshes the object's properties by reading them from the server. (Inherited from SfcInstance.)
Public method RemoveEvent Removes the specified Event object from the session.
Public method RemoveTarget Removes the Target object from the session.
Protected method ResetKey Do not reference this member directly in your code. It supports the SQL Server infrastructure. (Inherited from SfcInstance.)
Public method ScriptAlter Gets the alteration ISfcScript for the session.
Public method ScriptCreate Gets the creation ISfcScript for the session.
Public method ScriptDrop Gets the drop ISfcScript for the session.
Public method Serialize Serializes the instance to XML. (Inherited from SfcInstance.)
Public method Start Starts the Session object.
Public method Stop Stops the Session object.
Public method ToString Returns a string representation of the instance Urn. (Inherited from SfcInstance.)
Public method Validate(String) Validates the specified method name.
Public method Validate(String, array<Object[]) Validates the method specified by the name parameter.

Top

Events

  Name Description
Public event PropertyChanged CLS-compliant event for property changes. (Inherited from SfcInstance.)
Public event PropertyMetadataChanged CLS-compliant event for property metadata changes. (Inherited from SfcInstance.)

Top

Fields

  Name Description
Public fieldStatic member DefaultDispatchLatency Default dispatch latency is 30 seconds.
Public fieldStatic member DefaultMaxMemory The maximum amount of memory by default is 4 MB.
Public fieldStatic member InfiniteDispatchLatency 0 indicates that dispatch latency is infinite.
Public fieldStatic member NotStarted Session is currently not running.

Top

Explicit Interface Implementations

  Name Description
Explicit interface implemetationPrivate method ISfcDiscoverObject.Discover Discovers or alters dependency actions and events in the Session object.

Top

Remarks

The Session object is the main object that user code interacts with.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.SqlServer.Management.XEvent Namespace