PRB: Problems Sending Many Messages Using Multiple Threads

ID: Q181697

The information in this article applies to:

SYMPTOMS

When you use Collaboration Data Objects for Microsoft Windows NT Server (CDONTS) to send a large number of messages using multiple threads, the Send method may return the following Windows NT error code:

   Code: 32L
   Name: ERROR_SHARING_VIOLATION
   Description: The process cannot access the file because it is being
   used by another process.

In addition, one or more messages may not be sent. These problems can occur when you use the Send method with the CDONTS NewMail object or Message object.

CAUSE

When you use CDONTS to send messages, the messages are converted to files. The files are stored in a folder until they are transferred using Simple Mail Transfer Protocol (SMTP). When you use CDONTS to send a large number of messages using multiple threads, more than one thread may create a file with the same name. When this occurs, the Send method returns the error code described above.

Under certain circumstances, creating multiple files with the same name may cause one or more messages to be overwritten. When this occurs, the messages that are overwritten are not delivered.

WORKAROUND

To work around this problem, use a critical section to serialize calls to the Send method.

STATUS

Microsoft has confirmed this to be a problem in Collaboration Data Objects for NTS version 1.2. We are researching this problem and will post additional information here in the Microsoft Knowledge Base as it becomes available.

Keywords          : kberrmsg kbCDONTS kbGrpMsg 
Version           : WINDOWS:1.2
Platform          : WINDOWS
Issue type        : kbprb
Solution Type     : kbpending

Last Reviewed: April 8, 1999