开发者

RavenDB Session > 30

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 d开发者_如何学Pythono 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


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


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 = 100;
      }
   }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜