Platform SDK: Exchange 2000 Server |
[This is preliminary documentation and subject to change.]
The following information is important to know when developing the interfaces for synchronous event sinks.
The item being passed through the synchronous event transaction is not the item in the Web Store. The item being passed is the item in transition--a copy. Additionally, for the OnSyncSave event, the sink is given a URL to an original image of the item before any synchronous events were called.
The following illustration shows a Web Store item and how event sinks affect it.
Note Asynchronous events are processed in no specified or guaranteed order. The event source does not wait for asynchronous events to finish.
As the above illustration shows, Synchronous events are always called twice, once for the transaction and once for commit or abort. It is important to add code in your methods for handling synchronous events to determine which type of call is being made. The filter in an IExStoreSyncEvents::OnSyncSave method could look like this:
if( lFlags & EVT_SYNC_BEGIN ) { Log(pLog,"-----------EVT_SYNC_BEGIN-----------\r\n"); //Handle the sink here. } else if( lFlags & EVT_SYNC_COMMITTED ) { Log(pLog,"---------EVT_SYNC_COMMITTED---------\r\n"); //Handle the commit here. } else if( lFlags & EVT_SYNC_ABORTED ) { Log(pLog,"----------EVT_SYNC_ABORTED----------\r\n"); //Handle the abort here. }
An item created during the context of a transaction does not exist in the Web Store until the transaction has been committed. Actions performed within a transaction will not cause another event to occur until the transaction has been committed. This means that if an OnSyncSave sink saves some other item, the Web Store processes the new OnSave event only after the current transaction is committed. Additionally, it is not possible to create an item and then open it using IBindResource::Bind without first committing the transaction.