|
using System;
using System.Threading;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Contexts;
using System.Runtime.Remoting.Activation;
using System.Runtime.Remoting.Messaging;
using System.Data.SqlClient;
using System.Data;
namespace RSI.Transactions
{
[DbConnection]
[Transaction(TransactionOption.Required)]
class TestClass1 : ContextBoundObject
{
public TestClass1() {}
[AutoComplete]
public void TrxRequired()
{
TestClass2 tc2 = new TestClass2();
// throw new System.Exception("This is an exception");
tc2.TrxRequired();
TrxRequired2("ooga");
tc2.TrxRequired2("booga");
// ContextUtil.SetComplete();
}
[AutoComplete]
public void TrxRequired2(string strText)
{
}
}
[Transaction(TransactionOption.RequiresNew)]
[DbConnection]
class TestClass2 : ContextBoundObject
{
public TestClass2() {}
[AutoComplete]
public void TrxRequired()
{
TrxRequired2("ooga");
}
[AutoComplete]
public void TrxRequired2(string strText)
{
}
}
class Class1
{
static void Main(string[] args)
{
//
// TODO: Add code to start application here
//
try
{
TestClass1 tc1 = new TestClass1();
tc1.TrxRequired();
}
catch(System.Exception exc)
{
System.Console.WriteLine(exc.Message);
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.