You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
longscopeID=SqlClientEventSource.Log.TryScopeEnterEvent("SqlCommandSet.ExecuteNonQuery | API | Object Id {0}, Commands executed in Batch RPC mode",ObjectID);
282
-
283
-
try
281
+
using(TryEventScope.Create("SqlCommandSet.ExecuteNonQuery | API | Object Id {0}, Commands executed in Batch RPC mode",ObjectID))
284
282
{
285
283
BatchCommand.BatchRPCMode=true;
286
284
BatchCommand.ClearBatchCommand();
@@ -293,10 +291,6 @@ internal int ExecuteNonQuery()
longscopeID=SqlClientEventSource.Log.TryScopeEnterEvent("SqlConnection.BeginDbTransaction | API | Object Id {0}, Isolation Level {1}",ObjectID,(int)isolationLevel);
1038
-
try
1037
+
using(TryEventScope.Create("SqlConnection.BeginDbTransaction | API | Object Id {0}, Isolation Level {1}",ObjectID,(int)isolationLevel))
longscopeID=SqlClientEventSource.Log.TryScopeEnterEvent("SqlConnection.BeginTransaction | API | Object Id {0}, Iso {1}, Transaction Name '{2}'",ObjectID,(int)iso,transactionName);
1062
-
try
1056
+
using(TryEventScope.Create(SqlClientEventSource.Log.TryScopeEnterEvent("SqlConnection.BeginTransaction | API | Object Id {0}, Iso {1}, Transaction Name '{2}'",ObjectID,(int)iso,transactionName)))
1063
1057
{
1064
-
statistics=SqlStatistics.StartTimer(Statistics);
1065
-
1066
-
SqlTransactiontransaction;
1067
-
boolisFirstAttempt=true;
1068
-
do
1058
+
try
1069
1059
{
1070
-
transaction=GetOpenTdsConnection().BeginSqlTransaction(iso,transactionName,isFirstAttempt);// do not reconnect twice
1071
-
Debug.Assert(isFirstAttempt||!transaction.InternalTransaction.ConnectionHasBeenRestored,"Restored connection on non-first attempt");
longscopeID=SqlClientEventSource.Log.TryScopeEnterEvent("SqlConnection.Close | API | Object Id {0}",ObjectID);
1141
-
SqlClientEventSource.Log.TryCorrelationTraceEvent("SqlConnection.Close | API | Correlation | Object Id {0}, Activity Id {1}, Client Connection Id {2}",ObjectID,ActivityCorrelator.Current,ClientConnectionId);
1142
-
try
1136
+
using(TryEventScope.Create("SqlConnection.Close | API | Object Id {0}",ObjectID))
1143
1137
{
1138
+
SqlClientEventSource.Log.TryCorrelationTraceEvent("SqlConnection.Close | API | Correlation | Object Id {0}, Activity Id {1}, Client Connection Id {2}",ObjectID,ActivityCorrelator.Current,ClientConnectionId);
1139
+
1144
1140
ConnectionStatepreviousState=State;
1145
1141
GuidoperationId=default(Guid);
1146
1142
GuidclientConnectionId=default(Guid);
@@ -1214,10 +1210,6 @@ public override void Close()
longscopeID=SqlClientEventSource.Log.TryScopeEnterEvent("SqlConnection.Open | API | Correlation | Object Id {0}, Activity Id {1}",ObjectID,ActivityCorrelator.Current);
1264
-
SqlClientEventSource.Log.TryCorrelationTraceEvent("SqlConnection.Open | API | Correlation | Object Id {0}, Activity Id {1}",ObjectID,ActivityCorrelator.Current);
1265
-
try
1255
+
using(TryEventScope.Create("SqlConnection.Open | API | Correlation | Object Id {0}, Activity Id {1}",ObjectID,ActivityCorrelator.Current))
1266
1256
{
1257
+
SqlClientEventSource.Log.TryCorrelationTraceEvent("SqlConnection.Open | API | Correlation | Object Id {0}, Activity Id {1}",ObjectID,ActivityCorrelator.Current);
0 commit comments