Поделиться через


EventCollector.Abort Method

Discards the current event batch and all event data associated with it.

Пространство имен: Microsoft.SqlServer.NotificationServices
Сборка: Microsoft.SqlServer.NotificationServices (in microsoft.sqlserver.notificationservices.dll)

Синтаксис

'Декларация
Public Sub Abort
public void Abort ()
public:
virtual void Abort () sealed
public final void Abort ()
public final function Abort ()

Замечания

An event provider calls the Write method to submit an event (encapsulated as an Event) to an EventCollector. The EventCollector gathers all submitted events into an event batch. The event batch is submitted to the Notification Services application database for processing when the event provider calls the Commit method.

The EventCollector creates a new event batch when the event provider first calls Write, and then again on the first Write call after an Abort or Commit call.

An event provider can force the current batch to be discarded by calling the Abort method.

Пример

The following examples show how to use the Abort method to discard an event batch.

These examples use the Microsoft.SqlServer.NotificationServices namespace.

Try
    'Add event batch processing code here.
Catch e As System.Exception
    'Discard the event batch if there is an error.
    myEventCollector.Abort()
End Try
try
{
    //Add event batch processing code here.
}
catch (System.Exception e)
{
    //Discard the event batch if there is an error.
    myEventCollector.Abort();
}

Синхронизация потоков

Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Платформы

Платформы разработки

Список поддерживаемых платформ см. в разделе Hardware and Software Requirements for Installing SQL Server 2005.

Целевые платформы

Список поддерживаемых платформ см. в разделе Hardware and Software Requirements for Installing SQL Server 2005.

См. также

Справочник

EventCollector Class
EventCollector Members
Microsoft.SqlServer.NotificationServices Namespace