LogRecord 클래스
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
COM+ CrmLogRecordRead 구조체로 전달되는 구조화되지 않은 로그 레코드를 나타냅니다. 이 클래스는 상속할 수 없습니다.
public ref class LogRecord sealed
public sealed class LogRecord
type LogRecord = class
Public NotInheritable Class LogRecord
- 상속
-
LogRecord
예제
다음 코드 예제에서는이 클래스의 사용을 보여 줍니다.
public:
virtual bool AbortRecord(LogRecord^ log) override
{
// Check the validity of the record.
if (log == nullptr)
{
return true;
}
array<Object^>^ record = dynamic_cast<array<Object^>^>(log->Record);
if (record == nullptr)
{
return true;
}
if (record->Length != 2)
{
return true;
}
// Extract old account data from the record.
String^ filename = (String^) record[0];
int balance = (int) record[1];
// Restore the old state of the account.
WriteAccountBalance(filename, balance);
return false;
}
public override bool AbortRecord (LogRecord log)
{
// Check the validity of the record.
if (log == null) return(true);
Object[] record = log.Record as Object[];
if (record == null) return(true);
if (record.Length != 2) return(true);
// Extract old account data from the record.
string filename = (string) record[0];
int balance = (int) record[1];
// Restore the old state of the account.
AccountManager.WriteAccountBalance(filename, balance);
return(false);
}
Public Overrides Function AbortRecord(ByVal log As LogRecord) As Boolean
' Check the validity of the record.
If log Is Nothing Then
Return True
End If
Dim record As [Object]() = log.Record
If record Is Nothing Then
Return True
End If
If record.Length <> 2 Then
Return True
End If
' Extract old account data from the record.
Dim filename As String = CStr(record(0))
Dim balance As Integer = Fix(record(1))
' Restore the old state of the account.
AccountManager.WriteAccountBalance(filename, balance)
Return False
End Function 'AbortRecord
설명
구조화되지 않은 로그 레코드는 COM+ CrmLogRecordRead 구조로 전달됩니다. 사용자 데이터(단일 BLOB) 외에도 디버깅 또는 오류 찾기에 유용한 추가 필드가 포함됩니다.
Flags 필드는 이 레코드가 특정 시점에 잊혀졌는지 여부와 기록된 시기에 대한 추가 정보를 제공하는 비트 필드입니다.
Sequence 필드는 로그 레코드의 시퀀스 번호를 제공합니다. 대부분의 경우 시퀀스 번호는 순차적이지만 CRM(보상 Resource Manager) Compensator에 전달되지 않는 내부 로그 레코드로 인해 반드시 연속되는 것은 아닙니다.
속성
| Name | Description |
|---|---|
| Flags |
로그 레코드가 기록된 시기를 나타내는 값을 가져옵니다. |
| Record |
로그 레코드 사용자 데이터를 가져옵니다. |
| Sequence |
로그 레코드의 시퀀스 번호입니다. |
메서드
| Name | Description |
|---|---|
| Equals(Object) |
지정한 개체와 현재 개체가 같은지 여부를 확인합니다. (다음에서 상속됨 Object) |
| GetHashCode() |
기본 해시 함수로 작동합니다. (다음에서 상속됨 Object) |
| GetType() |
현재 인스턴스의 Type 가져옵니다. (다음에서 상속됨 Object) |
| MemberwiseClone() |
현재 Object단순 복사본을 만듭니다. (다음에서 상속됨 Object) |
| ToString() |
현재 개체를 나타내는 문자열을 반환합니다. (다음에서 상속됨 Object) |