* 구성 요소에서 요청한 자동 트랜잭션 형식을 지정합니다.
.NET Framework 클래스 라이브러리
.NET Framework 클래스 라이브러리
TransactionOption 열거형
System.EnterpriseServices의 TransactionOption을 통해 COM+에서 Transaction 설정을 간단히 할 수 있다.
System.EnterpriseServices의 TransactionOption을 통해 COM+에서 Transaction 설정을 간단히 할 수 있다.
MSDN의 내용을 간단히 살펴보면 다음과 같다.
구성 요소에서 요청한 자동 트랜잭션 형식을 지정합니다.
네임스페이스: System.EnterpriseServices
어셈블리: System.EnterpriseServices(system.enterpriseservices.dll)

C#
[SerializableAttribute]
public enum TransactionOption
[SerializableAttribute]
public enum TransactionOption

멤버 이름 | 설명 | |
---|---|---|
Disabled | 현재 컨텍스트에서 모든 트랜잭션을 무시합니다. | |
NotSupported | 트랜잭션을 제어하지 않고 컨텍스트에서 구성 요소를 만듭니다. | |
Required | 트랜잭션이 있으면 트랜잭션을 공유하고 필요하면 새 트랜잭션을 만듭니다. | |
RequiresNew | 현재 컨텍스트의 상태에 관계 없이 새 트랜잭션으로 구성 요소를 만듭니다. | |
Supported | 트랜잭션이 있으면 트랜잭션을 공유합니다. |

.NET 설치 도구(Regsvcs.exe)를 사용하면 ServicedComponent [ http://msdn2.microsoft.com/ko-kr/library/3kk2dasz(VS.80,printer).aspx ] 트랜잭션 옵션의 기본값을 Disabled [ http://msdn2.microsoft.com/ko-kr/library/bb462165(VS.80,printer).aspx ] 로 설정합니다.

다음 코드 예제에서는 TransactionOption 형식을 사용하는 방법을 보여 줍니다.
C#
using System;
using System.EnterpriseServices;
using System.Reflection;
// References: System.EnterpriseServices
// ServicedComponent : COM+
// TransactionOption값을 Disabled로 설정하였을 때는 현재의 모든 트랜잭션이 무시됩니다.
// 현재 트랜잭션이 있다고하여도 트랜젹션을 처리하지않고 무시가됩니다.
[Transaction(TransactionOption.Disabled)]
public class TransactionAttribute_TransactionDisabled : ServicedComponent
{
}
// TransactionOption값을 NotSupported로 설정하였을 때는 트랜잭션을 전혀 구성하지않는다고 생각하시면됩니다.
// 즉, 트랜잭션 처리가 없는 Select 문경우 NotSupported를 사용하시면됩니다.
[Transaction(TransactionOption.NotSupported)]
public class TransactionAttribute_TransactionNotSupported : ServicedComponent
{
}
// TransactionOption값을 Supported로 설정하였을 때는 트랜잭션을 사용하게 됩니다.
// 이는 트랜잭션이 있으면 트랜잭션을 공유하게 됩니다.
[Transaction(TransactionOption.Supported)]
public class TransactionAttribute_TransactionSupported : ServicedComponent
{
}
// TransactionOption값을 Required로 설정하였을 때는 트랜잭션을 지원하겠다는것입니다.
// 이는 트랜잭션이 있으면 트랜잭션을 공유하고 없으면 새 트랜잭션을 만들게됩니다.
// Insert, Delete, Update 경우 사용하면 되겠지요~
[Transaction(TransactionOption.Required)]
public class TransactionAttribute_TransactionRequired : ServicedComponent
{
}
// TransactionOption값을 RequiresNew로 설정하였을 때는 무조건 트랜잭션을 지원하겠다는것입니다.
// 이는 트랜잭션이 있든지없든지 상관없이 새 트랜잭션을 만들게됩니다.
[Transaction(TransactionOption.RequiresNew)]
public class TransactionAttribute_TransactionRequiresNew : ServicedComponent
{
}
http://msdn2.microsoft.com/ko-kr/library/system.enterpriseservices.transactionoption(VS.80).aspx
using System;
using System.EnterpriseServices;
using System.Reflection;
// References: System.EnterpriseServices
// ServicedComponent : COM+
// TransactionOption값을 Disabled로 설정하였을 때는 현재의 모든 트랜잭션이 무시됩니다.
// 현재 트랜잭션이 있다고하여도 트랜젹션을 처리하지않고 무시가됩니다.
[Transaction(TransactionOption.Disabled)]
public class TransactionAttribute_TransactionDisabled : ServicedComponent
{
}
// TransactionOption값을 NotSupported로 설정하였을 때는 트랜잭션을 전혀 구성하지않는다고 생각하시면됩니다.
// 즉, 트랜잭션 처리가 없는 Select 문경우 NotSupported를 사용하시면됩니다.
[Transaction(TransactionOption.NotSupported)]
public class TransactionAttribute_TransactionNotSupported : ServicedComponent
{
}
// TransactionOption값을 Supported로 설정하였을 때는 트랜잭션을 사용하게 됩니다.
// 이는 트랜잭션이 있으면 트랜잭션을 공유하게 됩니다.
[Transaction(TransactionOption.Supported)]
public class TransactionAttribute_TransactionSupported : ServicedComponent
{
}
// TransactionOption값을 Required로 설정하였을 때는 트랜잭션을 지원하겠다는것입니다.
// 이는 트랜잭션이 있으면 트랜잭션을 공유하고 없으면 새 트랜잭션을 만들게됩니다.
// Insert, Delete, Update 경우 사용하면 되겠지요~
[Transaction(TransactionOption.Required)]
public class TransactionAttribute_TransactionRequired : ServicedComponent
{
}
// TransactionOption값을 RequiresNew로 설정하였을 때는 무조건 트랜잭션을 지원하겠다는것입니다.
// 이는 트랜잭션이 있든지없든지 상관없이 새 트랜잭션을 만들게됩니다.
[Transaction(TransactionOption.RequiresNew)]
public class TransactionAttribute_TransactionRequiresNew : ServicedComponent
{
}
http://msdn2.microsoft.com/ko-kr/library/system.enterpriseservices.transactionoption(VS.80).aspx