diff --git a/src/NServiceBus.Transport.SqlServer/Queuing/SqlConstants.cs b/src/NServiceBus.Transport.SqlServer/Queuing/SqlConstants.cs index 9b62c4039..5dc49cc75 100644 --- a/src/NServiceBus.Transport.SqlServer/Queuing/SqlConstants.cs +++ b/src/NServiceBus.Transport.SqlServer/Queuing/SqlConstants.cs @@ -104,7 +104,7 @@ SELECT TOP 1 GETUTCDATE() as UtcNow, Due as NextDue ORDER BY Due"; public static readonly string PeekText = @" -SELECT isnull(cast(max([RowVersion]) - min([RowVersion]) + 1 AS int), 0) Id FROM {0} WITH (nolock)"; +SELECT isnull(cast(max([RowVersion]) - min([RowVersion]) + 1 AS int), 0) Id FROM {0} WITH (READPAST, READCOMMITTEDLOCK)"; public static readonly string AddMessageBodyStringColumn = @" IF NOT EXISTS (