さまざまなメソッドが必要で、それらを に配置するとしtransaction scope
ます。しかし、すべてのメソッドが接続を開きます。MSDTC service
そのため、Windowsサーバーで有効にする必要があります。しかし、これは共有ホスティング サーバーであり、有効にすることはできません。
class Debit
{
public void InsertA()
{
//InsertCode
}
}
class Credit
{
public void InsertB()
{
// InsertCode
}
}
using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required))
{
DebitBAL debit = new DebitBAL();
CreditBAL credit = new CreditBAL();
debit.InsertA();
credit.InsertB();
ts.complete();
}
私entity framework
は私の声明に使用します。transaction scope
共有ホスティングサーバーで使用するのは良い考えですか?