SessionLockLostException SessionLockLostException Class

The exception that is thrown to signal session lock lost errors.In the case of partitioned messaging entities, partitions sometimes move to achieve load balancing across Service Bus nodes; for example, when a node restarts or new nodes are added to share the load. When that happens, session locks can be lost, but messages are never lost. If a partition moves after the session is locked, then the acknowledge/complete message processing call fails, because the lock is lost. However, the message remains and you can try to read it again. Thus, you may receive a SessionLockLostException exception even though the message itself is not lost. In this case, you can retry the message processing operation.

Syntax

Declaration

[Serializable]
public sealed class SessionLockLostException : MessagingException, ISerializable, _Exception<Serializable>
Public NotInheritable Class SessionLockLostException
    Inherits MessagingException
    Implements ISerializable, _Exception

Inheritance Hierarchy

Constructors summary

Initializes a new instance of the SessionLockLostException class with a specified error message.

Initializes a new instance of the SessionLockLostException class with a specified error message and a reference to the inner exception that is the cause of this exception.

Constructors

  • SessionLockLostException(String)
    SessionLockLostException(String)

    Initializes a new instance of the SessionLockLostException class with a specified error message.

    public SessionLockLostException(string message)Public Sub New(message As String)

    Parameters

    • message

      The error message that explains the reason for the exception.

  • SessionLockLostException(String, Exception)
    SessionLockLostException(String, Exception)

    Initializes a new instance of the SessionLockLostException class with a specified error message and a reference to the inner exception that is the cause of this exception.

    public SessionLockLostException(string message, Exception innerException)Public Sub New(message As String, innerException As Exception)

    Parameters

    • message

      The error message that explains the reason for the exception.

    • innerException

      The exception that is the cause of the current exception.

Attributes

System.SerializableAttribute

Details

Namespace

Microsoft.ServiceBus.Messaging

Assembly

Microsoft.ServiceBus.dll