diff --git a/src/Infrastructure.EntityFramework/Repositories/CollectionRepository.cs b/src/Infrastructure.EntityFramework/Repositories/CollectionRepository.cs index e7806f5e77..786e5cbd8b 100644 --- a/src/Infrastructure.EntityFramework/Repositories/CollectionRepository.cs +++ b/src/Infrastructure.EntityFramework/Repositories/CollectionRepository.cs @@ -809,6 +809,7 @@ public class CollectionRepository : Repository>(collectionUsers)); await dbContext.SaveChangesAsync(); + await transaction.CommitAsync(); } catch (Exception ex) when (DatabaseExceptionHelpers.IsDuplicateKeyException(ex)) { + await transaction.RollbackAsync(); throw new DuplicateDefaultCollectionException(); } }