本文整理汇总了C#中TransactionRequest.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# TransactionRequest.ToString方法的具体用法?C# TransactionRequest.ToString怎么用?C# TransactionRequest.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TransactionRequest
的用法示例。
在下文中一共展示了TransactionRequest.ToString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ExecuteTransaction
override internal void ExecuteTransaction(
TransactionRequest transactionRequest,
string transactionName,
IsolationLevel iso,
SqlInternalTransaction internalTransaction,
bool isDelegateControlRequest) {
if (Bid.AdvancedOn) {
Bid.Trace("<sc.SqlInternalConnectionSmi.ExecuteTransaction|ADV> %d#, transactionRequest=%ls, transactionName='%ls', isolationLevel=%ls, internalTransaction=#%d transactionId=0x%I64x.\n",
base.ObjectID,
transactionRequest.ToString(),
(null != transactionName) ? transactionName : "null",
iso.ToString(),
(null != internalTransaction) ? internalTransaction.ObjectID : 0,
(null != internalTransaction) ? internalTransaction.TransactionId : SqlInternalTransaction.NullTransactionId
);
}
switch (transactionRequest) {
case TransactionRequest.Begin:
try {
_pendingTransaction = internalTransaction; // store this for the time being.
_smiConnection.BeginTransaction(transactionName, iso, _smiEventSink);
}
finally {
_pendingTransaction = null;
}
Debug.Assert(_smiEventSink.HasMessages || null != _currentTransaction, "begin transaction without TransactionStarted event?");
break;
case TransactionRequest.Commit:
Debug.Assert(null != _currentTransaction, "commit transaction without TransactionStarted event?");
_smiConnection.CommitTransaction(_currentTransaction.TransactionId, _smiEventSink);
break;
case TransactionRequest.Promote:
Debug.Assert(null != _currentTransaction, "promote transaction without TransactionStarted event?");
PromotedDTCToken = _smiConnection.PromoteTransaction(_currentTransaction.TransactionId, _smiEventSink);
break;
case TransactionRequest.Rollback:
case TransactionRequest.IfRollback:
Debug.Assert(null != _currentTransaction, "rollback/ifrollback transaction without TransactionStarted event?");
_smiConnection.RollbackTransaction(_currentTransaction.TransactionId, transactionName, _smiEventSink);
break;
case TransactionRequest.Save:
Debug.Assert(null != _currentTransaction, "save transaction without TransactionStarted event?");
_smiConnection.CreateTransactionSavePoint(_currentTransaction.TransactionId, transactionName, _smiEventSink);
break;
default:
Debug.Assert (false, "unhandled case for TransactionRequest");
break;
}
_smiEventSink.ProcessMessagesAndThrow();
}