You are currently browsing legacy 4.1 version of documentation. Click here to switch to the newest 5.1 version.
Session: How to Change Maximum Number of Requests per Session
By default, maximum number of requests that session can send to server is 30. This number, if everything is done correctly, should never be reached. Remote calls are expensive, and the number of remote calls per "session" should be as close to 1 as possible. If the limit is reached, it is a sure sign of either a
Select N+1 problem or other misuse of the session object.
Nevertheless, if needed, this number can be changed for single session or for all sessions.
To change maximum number of requests in a single session just manipulate
maxNumberOfRequestsPerSession field value from
advanced session operations.
session.advanced.maxNumberOfRequestsPerSession = 50;
To change maximum number of requests for all sessions (on particular store) the
maxNumberOfRequestsPerSession field from DocumentStore
conventions must be changed.
store.conventions.maxNumberOfRequestsPerSession = 100;
Injecting maxNumberOfRequestsPerSession from the Server
The maximum number of requests for all sessions can also be configured via injected client configuration from the Server. You can read more about this here.