事务,命令和连接之间的关系是什么?

时间:2014-12-19 19:31:11

标签: c# .net transactions transactionscope sqlconnection

按照代码所做的:

  1. 创建了一个事务范围。

  2. 在事务中创建并打开一个连接 范围在步骤1中创建。

  3. 使用已打开的连接提交命令。

  4. 连接已关闭。

  5. 创建新的交易范围。

  6. 同样的联系被打开,引起了人们的争夺 新事务创建的新事务中的连接 第5步中的范围实例。

  7. 使用已打开的连接提交命令。

  8. 第一个交易范围已完成并处理完毕 第二个。

  9. 在该连接上执行相同命令会发生什么?在第一个事务范围内调用Complete();Dispose();之前,即使连接已关闭,是否已提交这些命令?

    我认为交易根本不是由连接管理的,即使连接被两个事务使用,发送到不同事务的命令根本不相关,无论它们是否被发送到服务器使用相同的连接。我没错?

    按照代码:

    using (TransactionScope transactionScope1 = new TransactionScope())
    {
         traceSource.TraceEvent(TraceEventType.Information, 0, "BEFORE CREATE THE TRANSACTION SCOPE, OPEN AND USE THE CONNECTION");
         SqlConnection connection = new SqlConnection(CLEAR_CONNECTION_STRING);
         connection.Open();
         ExecuteCommand1(connection);
         connection.Close();
         traceSource.TraceEvent(TraceEventType.Information, 0, "AFTER CREATE THE TRANSACTION SCOPE, OPEN THE CONNECTION, USES IT AND CLOSE IT.");
    
         traceSource.TraceEvent(TraceEventType.Information, 0, "BEFORE CALL TransactionScope transactionScope2 = new TransactionScope(TransactionScopeOption.RequiresNew); .");
    
         using (TransactionScope transactionScope2 = new TransactionScope(TransactionScopeOption.RequiresNew))
         {
             traceSource.TraceEvent(TraceEventType.Information, 0, "BEFORE CALL connection.Open(); .");
             connection.Open();
             traceSource.TraceEvent(TraceEventType.Information, 0, "BEFORE EXECUTE THE SECOND COMMAND.");
             ExecuteCommand2(connection);
             traceSource.TraceEvent(TraceEventType.Information, 0, "BEFORE CLOSE THE CONNECTION.");
             connection.Close();
             traceSource.TraceEvent(TraceEventType.Information, 0, "AFTER CLOSE THE CONNECTION.");
    
             traceSource.TraceEvent(TraceEventType.Information, 0, "BEFORE transactionScope2.Complete(); .");
             transactionScope2.Complete();
         }             
    
         traceSource.TraceEvent(TraceEventType.Information, 0, "BEFORE transactionScope1.Complete(); .");
         transactionScope1.Complete();
         traceSource.TraceEvent(TraceEventType.Information, 0, "BEFORE transactionScope1.Dispose(); .");
     }
    

    按照日志内容:

    <E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
      <System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
        <EventID>0</EventID>
        <Type>3</Type>
        <SubType Name="Information">0</SubType>
        <Level>8</Level>
        <TimeCreated SystemTime="2014-12-19T20:32:30.7789227Z" />
        <Source Name="TransactionsLab" />
        <Correlation ActivityID="{00000000-0000-0000-0000-000000000000}" />
        <Execution ProcessName="TransactionsLab.vshost" ProcessID="11004" ThreadID="10" />
        <Channel/>
        <Computer>PCNAME</Computer>
      </System>
      <ApplicationData>BEFORE CREATE THE TRANSACTION SCOPE, OPEN AND USE THE CONNECTION</ApplicationData>
    </E2ETraceEvent>
    <E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
      <System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
        <EventID>0</EventID>
        <Type>3</Type>
        <SubType Name="Information">0</SubType>
        <Level>8</Level>
        <TimeCreated SystemTime="2014-12-19T20:32:30.7799199Z" />
        <Source Name="System.Transactions" />
        <Correlation ActivityID="{00000000-0000-0000-0000-000000000000}" />
        <Execution ProcessName="TransactionsLab.vshost" ProcessID="11004" ThreadID="10" />
        <Channel/>
        <Computer>PCNAME</Computer>
      </System>
      <ApplicationData>
        <TraceData>
          <DataItem>
            <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Information">
              <TraceIdentifier>http://msdn.microsoft.com/2004/06/System/Transactions/TransactionCreated</TraceIdentifier>
              <Description>Transaction Created</Description>
              <AppDomain>TransactionsLab.vshost.exe</AppDomain>
              <ExtendedData xmlns="http://schemas.microsoft.com/2004/03/Transactions/TransactionCreatedTraceRecord">
                <TraceSource>[Lightweight]</TraceSource>
                <TransactionTraceIdentifier>
                  <TransactionIdentifier>5a0cb948-beb4-4143-bccb-4dbd575daf55:16</TransactionIdentifier>
                  <CloneIdentifier>1</CloneIdentifier>
                </TransactionTraceIdentifier>
              </ExtendedData>
            </TraceRecord>
          </DataItem>
        </TraceData>
      </ApplicationData>
    </E2ETraceEvent>
    <E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
      <System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
        <EventID>0</EventID>
        <Type>3</Type>
        <SubType Name="Information">0</SubType>
        <Level>8</Level>
        <TimeCreated SystemTime="2014-12-19T20:32:30.7809183Z" />
        <Source Name="System.Transactions" />
        <Correlation ActivityID="{00000000-0000-0000-0000-000000000000}" />
        <Execution ProcessName="TransactionsLab.vshost" ProcessID="11004" ThreadID="10" />
        <Channel/>
        <Computer>PCNAME</Computer>
      </System>
      <ApplicationData>
        <TraceData>
          <DataItem>
            <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Information">
              <TraceIdentifier>http://msdn.microsoft.com/2004/06/System/Transactions/TransactionScopeCreated</TraceIdentifier>
              <Description>TransactionScope Created</Description>
              <AppDomain>TransactionsLab.vshost.exe</AppDomain>
              <ExtendedData xmlns="http://schemas.microsoft.com/2004/03/Transactions/TransactionScopeCreatedTraceRecord">
                <TraceSource>[Base]</TraceSource>
                <TransactionTraceIdentifier>
                  <TransactionIdentifier>5a0cb948-beb4-4143-bccb-4dbd575daf55:16</TransactionIdentifier>
                  <CloneIdentifier>2</CloneIdentifier>
                </TransactionTraceIdentifier>
                <TransactionScopeResult>CreatedTransaction</TransactionScopeResult>
              </ExtendedData>
            </TraceRecord>
          </DataItem>
        </TraceData>
      </ApplicationData>
    </E2ETraceEvent>
    <E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
      <System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
        <EventID>0</EventID>
        <Type>3</Type>
        <SubType Name="Information">0</SubType>
        <Level>8</Level>
        <TimeCreated SystemTime="2014-12-19T20:32:30.7819208Z" />
        <Source Name="System.Transactions" />
        <Correlation ActivityID="{00000000-0000-0000-0000-000000000000}" />
        <Execution ProcessName="TransactionsLab.vshost" ProcessID="11004" ThreadID="10" />
        <Channel/>
        <Computer>PCNAME</Computer>
      </System>
      <ApplicationData>
        <TraceData>
          <DataItem>
            <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Information">
              <TraceIdentifier>http://msdn.microsoft.com/2004/06/System/Transactions/Enlistment</TraceIdentifier>
              <Description>Enlistment Created</Description>
              <AppDomain>TransactionsLab.vshost.exe</AppDomain>
              <ExtendedData xmlns="http://schemas.microsoft.com/2004/03/Transactions/EnlistmentTraceRecord">
                <TraceSource>[Lightweight]</TraceSource>
                <EnlistmentTraceIdentifier>
                  <ResourceManagerId>00000000-0000-0000-0000-000000000000</ResourceManagerId>
                  <TransactionTraceIdentifier>
                    <TransactionIdentifier>5a0cb948-beb4-4143-bccb-4dbd575daf55:16</TransactionIdentifier>
                    <CloneIdentifier>2</CloneIdentifier>
                  </TransactionTraceIdentifier>
                  <EnlistmentIdentifier>0</EnlistmentIdentifier>
                </EnlistmentTraceIdentifier>
                <EnlistmentType>PromotableSinglePhase</EnlistmentType>
                <EnlistmentOptions>None</EnlistmentOptions>
              </ExtendedData>
            </TraceRecord>
          </DataItem>
        </TraceData>
      </ApplicationData>
    </E2ETraceEvent>
    <E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
      <System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
        <EventID>0</EventID>
        <Type>3</Type>
        <SubType Name="Information">0</SubType>
        <Level>8</Level>
        <TimeCreated SystemTime="2014-12-19T20:32:30.8400190Z" />
        <Source Name="TransactionsLab" />
        <Correlation ActivityID="{00000000-0000-0000-0000-000000000000}" />
        <Execution ProcessName="TransactionsLab.vshost" ProcessID="11004" ThreadID="10" />
        <Channel/>
        <Computer>PCNAME</Computer>
      </System>
      <ApplicationData>AFTER CREATE THE TRANSACTION SCOPE, OPEN THE CONNECTION, USES IT AND CLOSE IT.</ApplicationData>
    </E2ETraceEvent>
    <E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
      <System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
        <EventID>0</EventID>
        <Type>3</Type>
        <SubType Name="Information">0</SubType>
        <Level>8</Level>
        <TimeCreated SystemTime="2014-12-19T20:32:30.8412412Z" />
        <Source Name="TransactionsLab" />
        <Correlation ActivityID="{00000000-0000-0000-0000-000000000000}" />
        <Execution ProcessName="TransactionsLab.vshost" ProcessID="11004" ThreadID="10" />
        <Channel/>
        <Computer>PCNAME</Computer>
      </System>
      <ApplicationData>BEFORE CALL TransactionScope transactionScope2 = new TransactionScope(TransactionScopeOption.RequiresNew); .</ApplicationData>
    </E2ETraceEvent>
    <E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
      <System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
        <EventID>0</EventID>
        <Type>3</Type>
        <SubType Name="Information">0</SubType>
        <Level>8</Level>
        <TimeCreated SystemTime="2014-12-19T20:32:30.8422462Z" />
        <Source Name="System.Transactions" />
        <Correlation ActivityID="{00000000-0000-0000-0000-000000000000}" />
        <Execution ProcessName="TransactionsLab.vshost" ProcessID="11004" ThreadID="10" />
        <Channel/>
        <Computer>PCNAME</Computer>
      </System>
      <ApplicationData>
        <TraceData>
          <DataItem>
            <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Information">
              <TraceIdentifier>http://msdn.microsoft.com/2004/06/System/Transactions/TransactionCreated</TraceIdentifier>
              <Description>Transaction Created</Description>
              <AppDomain>TransactionsLab.vshost.exe</AppDomain>
              <ExtendedData xmlns="http://schemas.microsoft.com/2004/03/Transactions/TransactionCreatedTraceRecord">
                <TraceSource>[Lightweight]</TraceSource>
                <TransactionTraceIdentifier>
                  <TransactionIdentifier>5a0cb948-beb4-4143-bccb-4dbd575daf55:17</TransactionIdentifier>
                  <CloneIdentifier>1</CloneIdentifier>
                </TransactionTraceIdentifier>
              </ExtendedData>
            </TraceRecord>
          </DataItem>
        </TraceData>
      </ApplicationData>
    </E2ETraceEvent>
    <E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
      <System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
        <EventID>0</EventID>
        <Type>3</Type>
        <SubType Name="Information">0</SubType>
        <Level>8</Level>
        <TimeCreated SystemTime="2014-12-19T20:32:30.8432442Z" />
        <Source Name="System.Transactions" />
        <Correlation ActivityID="{00000000-0000-0000-0000-000000000000}" />
        <Execution ProcessName="TransactionsLab.vshost" ProcessID="11004" ThreadID="10" />
        <Channel/>
        <Computer>PCNAME</Computer>
      </System>
      <ApplicationData>
        <TraceData>
          <DataItem>
            <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Information">
              <TraceIdentifier>http://msdn.microsoft.com/2004/06/System/Transactions/TransactionScopeCreated</TraceIdentifier>
              <Description>TransactionScope Created</Description>
              <AppDomain>TransactionsLab.vshost.exe</AppDomain>
              <ExtendedData xmlns="http://schemas.microsoft.com/2004/03/Transactions/TransactionScopeCreatedTraceRecord">
                <TraceSource>[Base]</TraceSource>
                <TransactionTraceIdentifier>
                  <TransactionIdentifier>5a0cb948-beb4-4143-bccb-4dbd575daf55:17</TransactionIdentifier>
                  <CloneIdentifier>2</CloneIdentifier>
                </TransactionTraceIdentifier>
                <TransactionScopeResult>CreatedTransaction</TransactionScopeResult>
              </ExtendedData>
            </TraceRecord>
          </DataItem>
        </TraceData>
      </ApplicationData>
    </E2ETraceEvent>
    <E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
      <System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
        <EventID>0</EventID>
        <Type>3</Type>
        <SubType Name="Information">0</SubType>
        <Level>8</Level>
        <TimeCreated SystemTime="2014-12-19T20:32:30.8442750Z" />
        <Source Name="TransactionsLab" />
        <Correlation ActivityID="{00000000-0000-0000-0000-000000000000}" />
        <Execution ProcessName="TransactionsLab.vshost" ProcessID="11004" ThreadID="10" />
        <Channel/>
        <Computer>PCNAME</Computer>
      </System>
      <ApplicationData>BEFORE CALL connection.Open(); .</ApplicationData>
    </E2ETraceEvent>
    <E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
      <System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
        <EventID>0</EventID>
        <Type>3</Type>
        <SubType Name="Information">0</SubType>
        <Level>8</Level>
        <TimeCreated SystemTime="2014-12-19T20:32:30.8452783Z" />
        <Source Name="System.Transactions" />
        <Correlation ActivityID="{00000000-0000-0000-0000-000000000000}" />
        <Execution ProcessName="TransactionsLab.vshost" ProcessID="11004" ThreadID="10" />
        <Channel/>
        <Computer>PCNAME</Computer>
      </System>
      <ApplicationData>
        <TraceData>
          <DataItem>
            <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Information">
              <TraceIdentifier>http://msdn.microsoft.com/2004/06/System/Transactions/Enlistment</TraceIdentifier>
              <Description>Enlistment Created</Description>
              <AppDomain>TransactionsLab.vshost.exe</AppDomain>
              <ExtendedData xmlns="http://schemas.microsoft.com/2004/03/Transactions/EnlistmentTraceRecord">
                <TraceSource>[Lightweight]</TraceSource>
                <EnlistmentTraceIdentifier>
                  <ResourceManagerId>00000000-0000-0000-0000-000000000000</ResourceManagerId>
                  <TransactionTraceIdentifier>
                    <TransactionIdentifier>5a0cb948-beb4-4143-bccb-4dbd575daf55:17</TransactionIdentifier>
                    <CloneIdentifier>2</CloneIdentifier>
                  </TransactionTraceIdentifier>
                  <EnlistmentIdentifier>0</EnlistmentIdentifier>
                </EnlistmentTraceIdentifier>
                <EnlistmentType>PromotableSinglePhase</EnlistmentType>
                <EnlistmentOptions>None</EnlistmentOptions>
              </ExtendedData>
            </TraceRecord>
          </DataItem>
        </TraceData>
      </ApplicationData>
    </E2ETraceEvent>
    <E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
      <System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
        <EventID>0</EventID>
        <Type>3</Type>
        <SubType Name="Information">0</SubType>
        <Level>8</Level>
        <TimeCreated SystemTime="2014-12-19T20:32:30.8462788Z" />
        <Source Name="TransactionsLab" />
        <Correlation ActivityID="{00000000-0000-0000-0000-000000000000}" />
        <Execution ProcessName="TransactionsLab.vshost" ProcessID="11004" ThreadID="10" />
        <Channel/>
        <Computer>PCNAME</Computer>
      </System>
      <ApplicationData>BEFORE EXECUTE THE SECOND COMMAND.</ApplicationData>
    </E2ETraceEvent>
    <E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
      <System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
        <EventID>0</EventID>
        <Type>3</Type>
        <SubType Name="Information">0</SubType>
        <Level>8</Level>
        <TimeCreated SystemTime="2014-12-19T20:32:30.8522799Z" />
        <Source Name="TransactionsLab" />
        <Correlation ActivityID="{00000000-0000-0000-0000-000000000000}" />
        <Execution ProcessName="TransactionsLab.vshost" ProcessID="11004" ThreadID="10" />
        <Channel/>
        <Computer>PCNAME</Computer>
      </System>
      <ApplicationData>BEFORE CLOSE THE CONNECTION.</ApplicationData>
    </E2ETraceEvent>
    <E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
      <System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
        <EventID>0</EventID>
        <Type>3</Type>
        <SubType Name="Information">0</SubType>
        <Level>8</Level>
        <TimeCreated SystemTime="2014-12-19T20:32:30.8532787Z" />
        <Source Name="TransactionsLab" />
        <Correlation ActivityID="{00000000-0000-0000-0000-000000000000}" />
        <Execution ProcessName="TransactionsLab.vshost" ProcessID="11004" ThreadID="10" />
        <Channel/>
        <Computer>PCNAME</Computer>
      </System>
      <ApplicationData>AFTER CLOSE THE CONNECTION.</ApplicationData>
    </E2ETraceEvent>
    <E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
      <System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
        <EventID>0</EventID>
        <Type>3</Type>
        <SubType Name="Information">0</SubType>
        <Level>8</Level>
        <TimeCreated SystemTime="2014-12-19T20:32:30.8532787Z" />
        <Source Name="TransactionsLab" />
        <Correlation ActivityID="{00000000-0000-0000-0000-000000000000}" />
        <Execution ProcessName="TransactionsLab.vshost" ProcessID="11004" ThreadID="10" />
        <Channel/>
        <Computer>PCNAME</Computer>
      </System>
      <ApplicationData>BEFORE transactionScope2.Complete(); .</ApplicationData>
    </E2ETraceEvent>
    <E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
      <System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
        <EventID>0</EventID>
        <Type>3</Type>
        <SubType Name="Information">0</SubType>
        <Level>8</Level>
        <TimeCreated SystemTime="2014-12-19T20:32:30.8542792Z" />
        <Source Name="TransactionsLab" />
        <Correlation ActivityID="{00000000-0000-0000-0000-000000000000}" />
        <Execution ProcessName="TransactionsLab.vshost" ProcessID="11004" ThreadID="10" />
        <Channel/>
        <Computer>PCNAME</Computer>
      </System>
      <ApplicationData>BEFORE transactionScope2.Dispose(); .</ApplicationData>
    </E2ETraceEvent>
    <E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
      <System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
        <EventID>0</EventID>
        <Type>3</Type>
        <SubType Name="Information">0</SubType>
        <Level>8</Level>
        <TimeCreated SystemTime="2014-12-19T20:32:30.8552784Z" />
        <Source Name="System.Transactions" />
        <Correlation ActivityID="{00000000-0000-0000-0000-000000000000}" />
        <Execution ProcessName="TransactionsLab.vshost" ProcessID="11004" ThreadID="10" />
        <Channel/>
        <Computer>PCNAME</Computer>
      </System>
      <ApplicationData>
        <TraceData>
          <DataItem>
            <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Information">
              <TraceIdentifier>http://msdn.microsoft.com/2004/06/System/Transactions/TransactionScopeDisposed</TraceIdentifier>
              <Description>TransactionScope Disposed</Description>
              <AppDomain>TransactionsLab.vshost.exe</AppDomain>
              <ExtendedData xmlns="http://schemas.microsoft.com/2004/03/Transactions/TransactionScopeDisposedTraceRecord">
                <TraceSource>[Base]</TraceSource>
                <TransactionTraceIdentifier>
                  <TransactionIdentifier>5a0cb948-beb4-4143-bccb-4dbd575daf55:17</TransactionIdentifier>
                  <CloneIdentifier>2</CloneIdentifier>
                </TransactionTraceIdentifier>
              </ExtendedData>
            </TraceRecord>
          </DataItem>
        </TraceData>
      </ApplicationData>
    </E2ETraceEvent>
    <E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
      <System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
        <EventID>0</EventID>
        <Type>3</Type>
        <SubType Name="Information">0</SubType>
        <Level>8</Level>
        <TimeCreated SystemTime="2014-12-19T20:32:30.8562814Z" />
        <Source Name="TransactionsLab" />
        <Correlation ActivityID="{00000000-0000-0000-0000-000000000000}" />
        <Execution ProcessName="TransactionsLab.vshost" ProcessID="11004" ThreadID="10" />
        <Channel/>
        <Computer>PCNAME</Computer>
      </System>
      <ApplicationData>BEFORE transactionScope1.Complete(); .</ApplicationData>
    </E2ETraceEvent>
    <E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
      <System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
        <EventID>0</EventID>
        <Type>3</Type>
        <SubType Name="Information">0</SubType>
        <Level>8</Level>
        <TimeCreated SystemTime="2014-12-19T20:32:30.8572798Z" />
        <Source Name="TransactionsLab" />
        <Correlation ActivityID="{00000000-0000-0000-0000-000000000000}" />
        <Execution ProcessName="TransactionsLab.vshost" ProcessID="11004" ThreadID="10" />
        <Channel/>
        <Computer>PCNAME</Computer>
      </System>
      <ApplicationData>BEFORE transactionScope1.Dispose(); .</ApplicationData>
    </E2ETraceEvent>
    <E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
      <System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
        <EventID>0</EventID>
        <Type>3</Type>
        <SubType Name="Information">0</SubType>
        <Level>8</Level>
        <TimeCreated SystemTime="2014-12-19T20:32:30.8582802Z" />
        <Source Name="System.Transactions" />
        <Correlation ActivityID="{00000000-0000-0000-0000-000000000000}" />
        <Execution ProcessName="TransactionsLab.vshost" ProcessID="11004" ThreadID="10" />
        <Channel/>
        <Computer>PCNAME</Computer>
      </System>
      <ApplicationData>
        <TraceData>
          <DataItem>
            <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Information">
              <TraceIdentifier>http://msdn.microsoft.com/2004/06/System/Transactions/TransactionScopeDisposed</TraceIdentifier>
              <Description>TransactionScope Disposed</Description>
              <AppDomain>TransactionsLab.vshost.exe</AppDomain>
              <ExtendedData xmlns="http://schemas.microsoft.com/2004/03/Transactions/TransactionScopeDisposedTraceRecord">
                <TraceSource>[Base]</TraceSource>
                <TransactionTraceIdentifier>
                  <TransactionIdentifier>5a0cb948-beb4-4143-bccb-4dbd575daf55:16</TransactionIdentifier>
                  <CloneIdentifier>2</CloneIdentifier>
                </TransactionTraceIdentifier>
              </ExtendedData>
            </TraceRecord>
          </DataItem>
        </TraceData>
      </ApplicationData>
    </E2ETraceEvent>
    <E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
      <System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
        <EventID>0</EventID>
        <Type>3</Type>
        <SubType Name="Information">0</SubType>
        <Level>8</Level>
        <TimeCreated SystemTime="2014-12-19T20:32:30.8672795Z" />
        <Source Name="System.Transactions" />
        <Correlation ActivityID="{00000000-0000-0000-0000-000000000000}" />
        <Execution ProcessName="TransactionsLab.vshost" ProcessID="11004" ThreadID="2" />
        <Channel/>
        <Computer>PCNAME</Computer>
      </System>
      <ApplicationData>
        <TraceData>
          <DataItem>
            <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Information">
              <TraceIdentifier>http://msdn.microsoft.com/TraceCodes/System/ActivityTracing/2004/07/Diagnostics/AppDomainUnload</TraceIdentifier>
              <Description>AppDomain unloading.</Description>
              <AppDomain>TransactionsLab.vshost.exe</AppDomain>
              <ExtendedData xmlns="http://schemas.microsoft.com/2004/03/Transactions/DictionaryTraceRecord">
                <AppDomain.FriendlyName>TransactionsLab.vshost.exe</AppDomain.FriendlyName>
                <ProcessName>TransactionsLab.vshost</ProcessName>
                <ProcessId>11004</ProcessId>
              </ExtendedData>
            </TraceRecord>
          </DataItem>
        </TraceData>
      </ApplicationData>
    </E2ETraceEvent>
    

0 个答案:

没有答案