c# - Ravendb - calling SaveChanges took too much time - Stack Overflow

时间: 2025-01-06 admin 业界

We have a document with name Solutionpages and each solution pages contains items and each item contains three more lists. Right now the issue is we need to perform an operation on solutionpages for that we loaded 100 pages will all relevant using raven. And we just do changes in one solutionpage or didn't change any thing in any page and we call SaveChanges, it took approximately 30 seconds.

What I observe by calling the WhatChanged() function is that the $id related changes that are going to saved in ravendb is changed in a lot of places, like for example for solutionpage.$id, item[0].$id and so on. We suppose to load all the pages at once and we need to call SaveChanges() too, but how can I make SaveChanges() robust?

It is also to mention you that I figure out time took by SaveChanges using Visual Studio profiler and the issue confirm with SaveChanges()... Any help?