Inside C #, I have OracleConnection, which updates the database and a link to the outdated VB6 DLL that C # calls to update the database (inside the DLL, the ADODB.Connection object is used).
I need to wrap them both in one big transaction so that both managed and unmanaged updates are rolled back or performed together.
I tried to switch the C # class so that it inherited from System.EnterpriseServices.ServicedComponent and was decorated with [Transaction (TransactionOption.Required)], and then using [AutoComplete] on a method that runs the calling sequence, which eventually ends up in Call OracleConnection DLL and VB6.
Like this:
using System.EnterpriseServices;
{
[Transaction(TransactionOption.Required)]
public class MyClassTx: ServicedComponent
{
private MyClass1 _myClass1;
public MyClassTx()
{
}
[AutoComplete]
public void DoStuffTransactionally()
{
_MyClass1 = new MyClass1()
_MyClass1.DoSomeStuff();
}
}
}
, MyClassTx, :
{System.EnterpriseServices.RegistrationException: Invalid ServicedComponent-derived classes were found in the assembly.
(Classes must be public, concrete, have a public default constructor, and meet all other ComVisibility requirements)
, , . , .
COM +, ? , , VS2010, , ServicedComponent.
8 , COM +, #, !
, , , , !
Google .
!