System.ObjectDisposedException: Cannot access a disposed object #20966
-
Hi All, I have a query to load all ids in a collection using an index again Raven V5.4 public IEnumerable GetAllDocumentIds(string organisationId)
} the collection contain 510,000 items in production and when executed I get the following exception 2025-07-11 17:43:14.7416 | ERROR | DeleteOrganisationCommandHandler | Failed to delete organisation ORG_xxxxxx I am think I should use streaming Any suggestions |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
hi, you need to keep the session opened for the whole operation. Right after the return statement you are disposing the session (using block) but the enumeration of the results is happening afterwards. |
Beta Was this translation helpful? Give feedback.
-
Is this issue resolved in the current release 6.2.7, just need assurance |
Beta Was this translation helpful? Give feedback.
Apologies, I misread your code. This is an issue that we are addressing in upcoming build: #20826
We do have RC version compiled and ready: 5.4.210-rc-54186
Windows x64: https://daily-builds.s3.amazonaws.com/RavenDB-5.4.210-rc-54186-windows-x64.zip
Linux x64: https://daily-builds.s3.amazonaws.com/RavenDB-5.4.210-rc-54186-linux-x64.tar.bz2