TransactionOption 열거형

정의

구성 요소에서 요청한 자동 트랜잭션 형식을 지정합니다.

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

필드

Disabled 0

현재 컨텍스트에서 모든 트랜잭션을 무시합니다.

NotSupported 1

트랜잭션을 제어하지 않고 컨텍스트에서 구성 요소를 만듭니다.

Required 3

트랜잭션이 있으면 트랜잭션을 공유하고 필요하면 새 트랜잭션을 만듭니다.

RequiresNew 4

현재 컨텍스트의 상태에 관계 없이 새 트랜잭션으로 구성 요소를 만듭니다.

Supported 2

트랜잭션이 있으면 트랜잭션을 공유합니다.

예제

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

#using <System.EnterpriseServices.dll>

using namespace System;
using namespace System::EnterpriseServices;
using namespace System::Reflection;

// References:
// System.EnterpriseServices

// An instance of this class will not participate in transactions, but can
// share its caller's context even if its caller is configured as
// NotSupported, Supported, Required, or RequiresNew.
[Transaction(TransactionOption::Disabled)]
public ref class TransactionDisabled : public ServicedComponent
{
};

// An instance of this class will not participate in transactions, and will
// share its caller's context only if its caller is also configured as
// NotSupported.
[Transaction(TransactionOption::NotSupported)]
public ref class TransactionNotSupported : public ServicedComponent
{
};

// An instance of this class will participate in its caller's transaction
// if one exists.
[Transaction(TransactionOption::Supported)]
public ref class TransactionSupported : public ServicedComponent
{
};

// An instance of this class will participate in its caller's transaction
// if one exists. If not, a new transaction will be created for it.
[Transaction(TransactionOption::Required)]
public ref class TransactionRequired : public ServicedComponent
{
};

// A new transaction will always be created for an instance of this class.
[Transaction(TransactionOption::RequiresNew)]
public ref class TransactionRequiresNew : public ServicedComponent
{
};
using System;
using System.EnterpriseServices;
using System.Reflection;

// References:
// System.EnterpriseServices

// An instance of this class will not participate in transactions, but can
// share its caller's context even if its caller is configured as
// NotSupported, Supported, Required, or RequiresNew.
[Transaction(TransactionOption.Disabled)]
public class TransactionAttribute_TransactionDisabled : ServicedComponent
{
}

// An instance of this class will not participate in transactions, and will
// share its caller's context only if its caller is also configured as
// NotSupported.
[Transaction(TransactionOption.NotSupported)]
public class TransactionAttribute_TransactionNotSupported : ServicedComponent
{
}

// An instance of this class will participate in its caller's transaction
// if one exists.
[Transaction(TransactionOption.Supported)]
public class TransactionAttribute_TransactionSupported : ServicedComponent
{
}

// An instance of this class will participate in its caller's transaction
// if one exists. If not, a new transaction will be created for it.
[Transaction(TransactionOption.Required)]
public class TransactionAttribute_TransactionRequired : ServicedComponent
{
}

// A new transaction will always be created for an instance of this class.
[Transaction(TransactionOption.RequiresNew)]
public class TransactionAttribute_TransactionRequiresNew : ServicedComponent
{
}
Imports System.EnterpriseServices
Imports System.Reflection


' References:
' System.EnterpriseServices

' An instance of this class will not participate in transactions, but can
' share its caller's context even if its caller is configured as
' NotSupported, Supported, Required, or RequiresNew.
<Transaction(TransactionOption.Disabled)>  _
Public Class TransactionAttribute_TransactionDisabled
    Inherits ServicedComponent
End Class

' An instance of this class will not participate in transactions, and will
' share its caller's context only if its caller is also configured as
' NotSupported.
<Transaction(TransactionOption.NotSupported)>  _
Public Class TransactionAttribute_TransactionNotSupported
    Inherits ServicedComponent
End Class

' An instance of this class will participate in its caller's transaction
' if one exists.
<Transaction(TransactionOption.Supported)>  _
Public Class TransactionAttribute_TransactionSupported
    Inherits ServicedComponent
End Class

' An instance of this class will participate in its caller's transaction
' if one exists. If not, a new transaction will be created for it.
<Transaction(TransactionOption.Required)>  _
Public Class TransactionAttribute_TransactionRequired
    Inherits ServicedComponent
End Class

' A new transaction will always be created for an instance of this class.
<Transaction(TransactionOption.RequiresNew)>  _
Public Class TransactionAttribute_TransactionRequiresNew
    Inherits ServicedComponent
End Class

설명

.NET 설치 도구 (Regsvcs.exe)의 트랜잭션 옵션을 사용 하는 경우는 ServicedComponent 기본값으로 Disabled합니다.

적용 대상