RavenDB Session > 30

不想你离开。 提交于 2019-12-05 11:12:33

问题


If I'm trying to save a list of items I want to save that has a count > 30 I get an error saying

The maximum number of requests (30) allowed for this session has been reached. Raven limits the number of remote calls that a session is allowed to make as an early warning system. Sessions are expected to be short lived, and Raven provides facilities like Load(string[] keys) to load multiple documents at once and batch saves.

What can I do to get around this? The problem with this error is I'm not loading, I'm trying to save documents. Any ideas would be appreciated. Thank you


回答1:


Call Session.Store with each of your objects before you call Session.SaveChanges.




回答2:


Although not recommended; in special cases, you can set the Session.Advanced.MaxNumberOfRequestsPerSession property.

using (var docStore = store.Initialize())
   {
     using (var session = docStore.OpenSession())
      {
         session.Advanced.MaxNumberOfRequestsPerSession = 1000;
      }
   }


来源:https://stackoverflow.com/questions/5411037/ravendb-session-30

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!