Login  
Search All Forums
Dart Home | PowerTCP Mail for .NET | Custom Development Reply | PowerTCP Mail for .NET Topics | Forums   
AuthorForum: PowerTCP Mail for .NET
Topic: Collection was modified; enumeration operation may not execute.
tbeaulieu

From: Waltham, MA USA
Posts: 4
Member Since: 06/04/08
posted June 23, 2008 1:28 PM

Has anyone dealt with this condition while enumerating and processing messages in a folder? It happens when a message is added to the folder during enumeration.

I need to figure out a workaround that eliminates the need to restart the enumeration when this error happens, because it's too slow to fetch all the attachments again.

Is there a way to fetch a list of headers to then drive subsequent fetches (Get()) bases on that collection? I don't mind if I miss messages added after the initial cache.

Thanks.
tbeaulieu

From: Waltham, MA USA
Posts: 4
Member Since: 06/04/08
posted June 25, 2008 8:32 AM

I resolved this problem by caching a collection of mail headers - the set returned from Get() - and then fetching each message in full, driven by that cache set.

Looking back, had I driven my initial loop of the return set, instead of directly off the folder, this problem may have been avoided. Regardless, I like this approach better because each message is returned as it's processed, instead of all in one really long transaction up front.
Reply | PowerTCP Mail for .NET Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX