다음을 통해 공유


SynchronizationOption 열거형

정의

구성 요소에서 요청한 자동 동기화의 형식을 지정합니다.

public enum class SynchronizationOption
[System.Serializable]
public enum SynchronizationOption
[<System.Serializable>]
type SynchronizationOption = 
Public Enum SynchronizationOption
상속
SynchronizationOption
특성

필드

Disabled 0

COM+는 개체의 컨텍스트를 결정할 때 구성 요소의 동기화 요구 사항을 무시합니다.

NotSupported 1

이 값을 가진 개체는 호출자의 상태에 관계 없이 동기화에 참여할 수 없습니다. 이 설정은 트랜잭션이 아니고 JIT(Just-In-Time) 활성화를 사용하지 않는 구성 요소에만 사용할 수 있습니다.

Required 3

구성 요소에서 만들어진 모든 개체가 동기화되는지 확인합니다.

RequiresNew 4

이 값을 가진 개체는 호출에 관련된 모든 구성 요소 대신 COM+가 컨텍스트와 아파트를 관리하는 새로운 동기화에 참여해야 합니다.

Supported 2

이 값을 가진 개체는 동기화가 있는 경우 동기화에 참여합니다.

예제

다음 코드 예제에서는 SynchronizationOption 형식입니다.

#using <System.EnterpriseServices.dll>

using namespace System;
using namespace System::EnterpriseServices;

// References:
// System.EnterpriseServices

// An instance of this class will not join an activity, but can share its
// caller's context even if its caller is configured as NotSupported,
// Supported, Required, or RequiresNew.
[Synchronization(SynchronizationOption::Disabled)]
public ref class SynchronizationAttribute_SynchronizationDisabled :
    public ServicedComponent
{
};

// An instance of this class will not join an activity, and will share its
// caller's context only if its caller is also configured as NotSupported.
[Synchronization(SynchronizationOption::NotSupported)]
public ref class SynchronizationAttribute_SynchronizationNotSupported :
    public ServicedComponent
{
};

// An instance of this class will join its caller's activity if one exists.
[Synchronization(SynchronizationOption::Supported)]
public ref class SynchronizationAttribute_SynchronizationSupported :
    public ServicedComponent
{
};

// An instance of this class will join its caller's activity if one exists.
// If not, a new activity will be created for it.
[Synchronization(SynchronizationOption::Required)]
public ref class SynchronizationAttribute_SynchronizationRequired :
    public ServicedComponent
{
};

// A new activity will always be created for an instance of this class.
[Synchronization(SynchronizationOption::RequiresNew)]
public ref class SynchronizationAttribute_SynchronizationRequiresNew :
    public ServicedComponent
{
};
using System;
using System.EnterpriseServices;
using System.Reflection;

// References:
// System.EnterpriseServices

// An instance of this class will not join an activity, but can share its
// caller's context even if its caller is configured as NotSupported,
// Supported, Required, or RequiresNew.
[Synchronization(SynchronizationOption.Disabled)]
public class SynchronizationAttribute_SynchronizationDisabled :
    ServicedComponent
{
}

// An instance of this class will not join an activity, and will share its
// caller's context only if its caller is also configured as NotSupported.
[Synchronization(SynchronizationOption.NotSupported)]
public class SynchronizationAttribute_SynchronizationNotSupported :
    ServicedComponent
{
}

// An instance of this class will join its caller's activity if one exists.
[Synchronization(SynchronizationOption.Supported)]
public class SynchronizationAttribute_SynchronizationSupported :
    ServicedComponent
{
}

// An instance of this class will join its caller's activity if one exists.
// If not, a new activity will be created for it.
[Synchronization(SynchronizationOption.Required)]
public class SynchronizationAttribute_SynchronizationRequired :
    ServicedComponent
{
}

// A new activity will always be created for an instance of this class.
[Synchronization(SynchronizationOption.RequiresNew)]
public class SynchronizationAttribute_SynchronizationRequiresNew :
    ServicedComponent
{
}
Imports System.EnterpriseServices
Imports System.Reflection


' References:
' System.EnterpriseServices

' An instance of this class will not join an activity, but can share its
' caller's context even if its caller is configured as NotSupported,
' Supported, Required, or RequiresNew.
<Synchronization(SynchronizationOption.Disabled)>  _
Public Class SynchronizationAttribute_SynchronizationDisabled
    Inherits ServicedComponent
End Class

' An instance of this class will not join an activity, and will share its
' caller's context only if its caller is also configured as NotSupported.
<Synchronization(SynchronizationOption.NotSupported)>  _
Public Class SynchronizationAttribute_SynchronizationNotSupported
    Inherits ServicedComponent
End Class

' An instance of this class will join its caller's activity if one exists.
<Synchronization(SynchronizationOption.Supported)>  _
Public Class SynchronizationAttribute_SynchronizationSupported
    Inherits ServicedComponent
End Class

' An instance of this class will join its caller's activity if one exists.
' If not, a new activity will be created for it.
<Synchronization(SynchronizationOption.Required)>  _
Public Class SynchronizationAttribute_SynchronizationRequired
    Inherits ServicedComponent
End Class

' A new activity will always be created for an instance of this class.
<Synchronization(SynchronizationOption.RequiresNew)>  _
Public Class SynchronizationAttribute_SynchronizationRequiresNew
    Inherits ServicedComponent
End Class

적용 대상