1
0
mirror of https://github.com/bitwarden/server.git synced 2025-02-01 23:31:41 +01:00

adjusted transactions to prevent long locks

This commit is contained in:
Kyle Spearrin 2017-01-17 00:32:51 -05:00
parent 4c56a370a0
commit 143b4cb5ff

View File

@ -6,10 +6,10 @@ BEGIN
SET NOCOUNT ON
DECLARE @BatchSize INT = 100
BEGIN TRANSACTION User_DeleteById
WHILE @BatchSize > 0
BEGIN
BEGIN TRANSACTION User_DeleteById_Ciphers
DELETE TOP(@BatchSize)
FROM
[dbo].[Cipher]
@ -18,8 +18,12 @@ BEGIN
AND [Type] > 0
SET @BatchSize = @@ROWCOUNT
COMMIT TRANSACTION User_DeleteById_Ciphers
END
BEGIN TRANSACTION User_DeleteById
DELETE
FROM
[dbo].[Cipher]