Hi, I am having an OutOfMemoryException while upgrading a date field of several hundreds of thousands of entities in one transaction. Code sample :
Context : Dataobjects.Net 4.6.4.1531, the code is in an opened transaction which does many other upgrades but none will go out of memory. Question : Is this a bug or is there a better pattern to do this ? Can i use nested transaction for it ? Shall I call Stacktrace :
Thanks, Benoit |
Hello Benoit Nesme Domain building (especially in Perform and PerformSafely mode) is quite resource-intensive process. If you need only to update date fields you may try to move this operations to UpgradeHandler.OnComplete(Domain domain) when all the building operations are finished. I found some problems on disposing of session cache. We'll fix them in one of next versions, but, unfortunately, not in 4.6 branch. |
Hello Benoit Nesme
I suppose you upgrade a date field in OnStage. Am I right?
Hi Alexey, I am in the override of UpgradeHandler.OnUpgrade() Which indeed is called from OnStage()
I found my way through what I consider as a bug, splitting the big upgrade operation in two (under two different system sessions).
Can the call of weakcache.Add(item) be the issue of this outofmemory ?