TransactionManager is used to seemlessly enroll an EasyObject into a transaction. TransactionManager uses ADO.NET transactions and therefore is not a distributed transaction as you would get with COM+. You only have to use TransactionManager if two or more EasyObjects need to be saved as a transaction. The EasyObject.Save method is already protected by a transaction.
For a list of all members of this type, see TransactionManager Members.
System.Object
NCI.EasyObjects.TransactionManager
Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.
Transaction Rules:
VB.NET
Dim tx As TransactionManager = TransactionManager.ThreadTransactionMgr()
Try
tx.BeginTransaction()
emps.Save()
prds.Save()
tx.CommitTransaction()
Catch ex As Exception
tx.RollbackTransaction()
tx.ThreadTransactionMgrReset()
End Try
C# TransactionManager tx = TransactionManager.ThreadTransactionMgr();
try
{
tx.BeginTransaction();
emps.Save();
prds.Save();
tx.CommitTransaction();
}
catch(Exception ex)
{
tx.RollbackTransaction();
tx.ThreadTransactionMgrReset();
}
Namespace: NCI.EasyObjects
Assembly: NCI.EasyObjects (in NCI.EasyObjects.dll)
TransactionManager Members | NCI.EasyObjects Namespace | Save