ReservationCollection.Add(Int64) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Allocates a reservation and adds it to the collection. This method cannot be inherited.
public:
virtual void Add(long size);
public void Add (long size);
abstract member Add : int64 -> unit
override this.Add : int64 -> unit
Public Sub Add (size As Long)
Parameters
- size
- Int64
The size of the requested reservation, in bytes.
Implements
Exceptions
archiveTail
is not between the base and last sequence numbers of this sequence.
size
is invalid or exceeds maximum reservation size.
An I/O error occurs when creating the archive snapshot.
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 store is denied by the operating system.
The record sequence is full.
Examples
The following example shows how to manually make a reservation. Notice that this task can only be performed when using the CLFS-based LogRecordSequence class.
ReservationCollection reservations = recordSequence.CreateReservationCollection();
reservations.Add(lengthOfUndoRecord);
try
{
recordSequence.Append(recordData, userSqn, previousSqn, RecordAppendOptions.None);
}
catch (Exception)
{
reservations.Remove(lengthOfUndoRecord);
throw;
}
recordSequence.Append(undoRecordData, userSqn, previousSqn, RecordAppendOptions.ForceFlush, reservations);