Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

LogRecordSequence.BeginWriteRestartArea Method (IList<ArraySegment<Byte>>, SequenceNumber, ReservationCollection, AsyncCallback, Object)

Begins an asynchronous restart area write operation, using space previously reserved in the sequence. This method cannot be inherited.

Namespace:  System.IO.Log
Assembly:  System.IO.Log (in System.IO.Log.dll)
public IAsyncResult BeginWriteRestartArea(
	IList<ArraySegment<byte>> data,
	SequenceNumber newBaseSeqNum,
	ReservationCollection reservationCollection,
	AsyncCallback callback,
	Object state


Type: System.Collections.Generic.IList<ArraySegment<Byte>>

A list of byte array segments that will be concatenated and appended as the record.

Type: System.IO.Log.SequenceNumber

The new base sequence number. The specified sequence number must be greater than or equal to the current base sequence number.

Type: System.IO.Log.ReservationCollection

A ReservationCollection that contains the reservation that should be used for this restart area.

Type: System.AsyncCallback

An optional asynchronous callback, to be called when the restart area write is complete.

Type: System.Object

A user-provided object that distinguishes this particular asynchronous restart area write request from other requests.

Return Value

Type: System.IAsyncResult
An IAsyncResult that represents the asynchronous restart area write operation, which could still be pending.


IRecordSequence.BeginWriteRestartArea(IList<ArraySegment<Byte>>, SequenceNumber, ReservationCollection, AsyncCallback, Object)

newBaseSeqNum is not valid for this sequence.


The specified log enumeration start sequence number is invalid.


data cannot be appended because it is larger than the maximum record size.


reservationCollection was not created by this record sequence.


One or more of the parameters is null.


A new or existing archive tail or base of the active log is invalid.


newBaseSeqNum is not between the base and last sequence numbers of this sequence.


The request could not be performed because of an unexpected I/O exception.


The request could not be performed because of an I/O device error.


The method was called after the sequence has been disposed of.


There is not enough memory to continue the execution of the program.


Access for the specified log sequence is denied by the operating system.


The record sequence is full.

You should pass the IAsyncResult returned by this method to the EndWriteRestartArea method to ensure that the restart area write operation has completed and resources can be freed appropriately. If an error has occurred during an asynchronous restart area write operation, an exception is not thrown until the EndWriteRestartArea method is called with the IAsyncResult returned by this method.

Data contained in the data parameter will be concatenated into a single byte array for appending as the record. However, no provision is made for splitting data back into array segments when the record is read.

When the operation successfully completes, the base sequence number has been updated. All log records with sequence numbers less than the new base sequence number are inaccessible.

If a ReservationCollection is specified, the written restart area will consume space that has been previously reserved, using a reservation contained in the collection. If the method succeeds, it will consume the smallest reservation that can hold the data, and that reservation will be removed from the collection.

If a record sequence has been disposed of, or if you pass an invalid argument, exceptions are thrown immediately within this operation. Errors that occurred during an asynchronous append request, for example, a disk failure during the I/O request, will result in exceptions being thrown when the EndWriteRestartArea method is called.

.NET Framework

Supported in: 4.5.1, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft. All rights reserved.