Redigera

Dela via


ReservationCollection.Remove(Int64) Method

Definition

Releases a reservation of the specified size, if one has been made. This method cannot be inherited.

public:
 virtual bool Remove(long item);
public bool Remove (long item);
abstract member Remove : int64 -> bool
override this.Remove : int64 -> bool
Public Function Remove (item As Long) As Boolean

Parameters

item
Int64

The size of the reservation to release.

Returns

true if a reservation of the specified size was found and removed; otherwise, false.

Implements

Exceptions

No reservation large enough to fit the provided record can be found in the specified reservation collection.

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.

The record sequence is full.

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

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);  

Applies to