28. February 2010 21:26
by Chaks
5 Comments
You might ask what is new with Event Receivers in SharePoint 2010 and you are sure to get an answer that it is now possible to have event receivers for:
- List
- Workflows
Synchronous and Asynchronous Event Receivers
Now in SP2010, you can configure event receivers to be:
- Synchronous
- Asynchronous
By default event receivers are asynchronous meaning that they run under the SharePoint timer service (OWSTIMER.exe). This means that the event receivers:
- Are not executed immediately, rather it is scheduled to be executed by OWSTIMER.exe.
- Don’t run under w3wp.exe process anymore, so when you want to debug your event receivers, you have to attach to OWSTIMER.EXE and wait till they are executed.
However, you can control this behaviour using the Synchronization attribute:
If you set it to Synchronous, then the event receivers run immediately and under the w3wp.exe process. So, if your solution depends on event receivers highly and expect the results immediately, then you have to set it to Synchronous, else setting it to Asynchronous should do the job.