@@ -15,13 +15,13 @@ namespace Microsoft.Data.ProviderBase
1515 using System . Threading . Tasks ;
1616 using Microsoft . Data . Common ;
1717 using Microsoft . Data . SqlClient ;
18- using SysTx = System . Transactions ;
18+ using System . Transactions ;
1919
2020 internal abstract class DbConnectionInternal
2121 {
2222 private static int _objectTypeCount ;
2323 internal readonly int _objectID = Interlocked . Increment ( ref _objectTypeCount ) ;
24- private SysTx . TransactionCompletedEventHandler _transactionCompletedEventHandler = null ;
24+ private TransactionCompletedEventHandler _transactionCompletedEventHandler = null ;
2525
2626 internal static readonly StateChangeEventArgs StateChangeClosed = new StateChangeEventArgs ( ConnectionState . Open , ConnectionState . Closed ) ;
2727 internal static readonly StateChangeEventArgs StateChangeOpen = new StateChangeEventArgs ( ConnectionState . Closed , ConnectionState . Open ) ;
@@ -43,13 +43,13 @@ internal abstract class DbConnectionInternal
4343
4444 private DateTime _createTime ; // when the connection was created.
4545
46- private SysTx . Transaction _enlistedTransaction ; // [usage must be thread-safe] the transaction that we're enlisted in, either manually or automatically
46+ private Transaction _enlistedTransaction ; // [usage must be thread-safe] the transaction that we're enlisted in, either manually or automatically
4747
4848 // _enlistedTransaction is a clone, so that transaction information can be queried even if the original transaction object is disposed.
4949 // However, there are times when we need to know if the original transaction object was disposed, so we keep a reference to it here.
5050 // This field should only be assigned a value at the same time _enlistedTransaction is updated.
5151 // Also, this reference should not be disposed, since we aren't taking ownership of it.
52- private SysTx . Transaction _enlistedTransactionOriginal ;
52+ private Transaction _enlistedTransactionOriginal ;
5353
5454#if DEBUG
5555 private int _activateCount ; // debug only counter to verify activate/deactivates are in sync.
@@ -83,15 +83,15 @@ internal bool CanBePooled
8383 }
8484 }
8585
86- protected internal SysTx . Transaction EnlistedTransaction
86+ protected internal Transaction EnlistedTransaction
8787 {
8888 get
8989 {
9090 return _enlistedTransaction ;
9191 }
9292 set
9393 {
94- SysTx . Transaction currentEnlistedTransaction = _enlistedTransaction ;
94+ Transaction currentEnlistedTransaction = _enlistedTransaction ;
9595 if ( ( ( null == currentEnlistedTransaction ) && ( null != value ) )
9696 || ( ( null != currentEnlistedTransaction ) && ! currentEnlistedTransaction . Equals ( value ) ) )
9797 { // WebData 20000024
@@ -104,8 +104,8 @@ protected internal SysTx.Transaction EnlistedTransaction
104104 // SQLBUDT #230558 we need to use a clone of the transaction
105105 // when we store it, or we'll end up keeping it past the
106106 // duration of the using block of the TransactionScope
107- SysTx . Transaction valueClone = null ;
108- SysTx . Transaction previousTransactionClone = null ;
107+ Transaction valueClone = null ;
108+ Transaction previousTransactionClone = null ;
109109 try
110110 {
111111 if ( null != value )
@@ -188,7 +188,7 @@ protected bool EnlistedTransactionDisposed
188188 {
189189 bool disposed ;
190190
191- SysTx . Transaction currentEnlistedTransactionOriginal = _enlistedTransactionOriginal ;
191+ Transaction currentEnlistedTransactionOriginal = _enlistedTransactionOriginal ;
192192 if ( currentEnlistedTransactionOriginal != null )
193193 {
194194 disposed = currentEnlistedTransactionOriginal . TransactionInformation == null ;
@@ -385,9 +385,9 @@ public ConnectionState State
385385
386386 internal virtual bool IsAccessTokenExpired => false ;
387387
388- abstract protected void Activate ( SysTx . Transaction transaction ) ;
388+ abstract protected void Activate ( Transaction transaction ) ;
389389
390- internal void ActivateConnection ( SysTx . Transaction transaction )
390+ internal void ActivateConnection ( Transaction transaction )
391391 {
392392 // Internal method called from the connection pooler so we don't expose
393393 // the Activate method publicly.
@@ -415,7 +415,7 @@ internal void AddWeakReference(object value, int tag)
415415 _referenceCollection . Add ( value , tag ) ;
416416 }
417417
418- abstract public DbTransaction BeginTransaction ( IsolationLevel il ) ;
418+ abstract public DbTransaction BeginTransaction ( System . Data . IsolationLevel il ) ;
419419
420420 virtual public void ChangeDatabase ( string value )
421421 {
@@ -654,7 +654,7 @@ public virtual void Dispose()
654654 // Dispose of the _enlistedTransaction since it is a clone
655655 // of the original reference.
656656 // VSDD 780271 - _enlistedTransaction can be changed by another thread (TX end event)
657- SysTx . Transaction enlistedTransaction = Interlocked . Exchange ( ref _enlistedTransaction , null ) ;
657+ Transaction enlistedTransaction = Interlocked . Exchange ( ref _enlistedTransaction , null ) ;
658658 if ( enlistedTransaction != null )
659659 {
660660 enlistedTransaction . Dispose ( ) ;
@@ -681,7 +681,7 @@ protected internal void UnDoomThisConnection()
681681 _connectionIsDoomed = false ;
682682 }
683683
684- abstract public void EnlistTransaction ( SysTx . Transaction transaction ) ;
684+ abstract public void EnlistTransaction ( Transaction transaction ) ;
685685
686686 virtual protected internal DataTable GetSchema ( DbConnectionFactory factory , DbConnectionPoolGroup poolGroup , DbConnection outerConnection , string collectionName , string [ ] restrictions )
687687 {
@@ -865,21 +865,21 @@ internal void RemoveWeakReference(object value)
865865 // Cleanup connection's transaction-specific structures (currently used by Delegated transaction).
866866 // This is a separate method because cleanup can be triggered in multiple ways for a delegated
867867 // transaction.
868- virtual protected void CleanupTransactionOnCompletion ( SysTx . Transaction transaction )
868+ virtual protected void CleanupTransactionOnCompletion ( Transaction transaction )
869869 {
870870 }
871871
872872 internal void DetachCurrentTransactionIfEnded ( )
873873 {
874- SysTx . Transaction enlistedTransaction = EnlistedTransaction ;
874+ Transaction enlistedTransaction = EnlistedTransaction ;
875875 if ( enlistedTransaction != null )
876876 {
877877 bool transactionIsDead ;
878878 try
879879 {
880- transactionIsDead = ( SysTx . TransactionStatus . Active != enlistedTransaction . TransactionInformation . Status ) ;
880+ transactionIsDead = ( TransactionStatus . Active != enlistedTransaction . TransactionInformation . Status ) ;
881881 }
882- catch ( SysTx . TransactionException )
882+ catch ( TransactionException )
883883 {
884884 // If the transaction is being processed (i.e. is part way through a rollback\commit\etc then TransactionInformation.Status will throw an exception)
885885 transactionIsDead = true ;
@@ -892,7 +892,7 @@ internal void DetachCurrentTransactionIfEnded()
892892 }
893893
894894 // Detach transaction from connection.
895- internal void DetachTransaction ( SysTx . Transaction transaction , bool isExplicitlyReleasing )
895+ internal void DetachTransaction ( Transaction transaction , bool isExplicitlyReleasing )
896896 {
897897 SqlClientEventSource . Log . TryPoolerTraceEvent ( "<prov.DbConnectionInternal.DetachTransaction|RES|CPOOL> {0}, Transaction Completed. (pooledCount={1})" , ObjectID , _pooledCount ) ;
898898
@@ -906,7 +906,7 @@ internal void DetachTransaction(SysTx.Transaction transaction, bool isExplicitly
906906 DbConnection owner = Owner ;
907907 if ( isExplicitlyReleasing || UnbindOnTransactionCompletion || owner is null )
908908 {
909- SysTx . Transaction currentEnlistedTransaction = _enlistedTransaction ;
909+ Transaction currentEnlistedTransaction = _enlistedTransaction ;
910910 if ( currentEnlistedTransaction != null && transaction . Equals ( currentEnlistedTransaction ) )
911911 {
912912 // We need to remove the transaction completed event handler to cease listening for the transaction to end.
@@ -924,7 +924,7 @@ internal void DetachTransaction(SysTx.Transaction transaction, bool isExplicitly
924924 }
925925
926926 // Handle transaction detach, pool cleanup and other post-transaction cleanup tasks associated with
927- internal void CleanupConnectionOnTransactionCompletion ( SysTx . Transaction transaction )
927+ internal void CleanupConnectionOnTransactionCompletion ( Transaction transaction )
928928 {
929929 DetachTransaction ( transaction , false ) ;
930930
@@ -935,9 +935,9 @@ internal void CleanupConnectionOnTransactionCompletion(SysTx.Transaction transac
935935 }
936936 }
937937
938- void TransactionCompletedEvent ( object sender , SysTx . TransactionEventArgs e )
938+ void TransactionCompletedEvent ( object sender , TransactionEventArgs e )
939939 {
940- SysTx . Transaction transaction = e . Transaction ;
940+ Transaction transaction = e . Transaction ;
941941 SqlClientEventSource . Log . TryPoolerTraceEvent ( "<prov.DbConnectionInternal.TransactionCompletedEvent|RES|CPOOL> {0}, Transaction Completed. (pooledCount = {1})" , ObjectID , _pooledCount ) ;
942942
943943 CleanupTransactionOnCompletion ( transaction ) ;
@@ -947,9 +947,9 @@ void TransactionCompletedEvent(object sender, SysTx.TransactionEventArgs e)
947947
948948 // TODO: Review whether we need the unmanaged code permission when we have the new object model available.
949949 [ SecurityPermission ( SecurityAction . Assert , Flags = SecurityPermissionFlag . UnmanagedCode ) ]
950- private void TransactionOutcomeEnlist ( SysTx . Transaction transaction )
950+ private void TransactionOutcomeEnlist ( Transaction transaction )
951951 {
952- _transactionCompletedEventHandler ??= new SysTx . TransactionCompletedEventHandler ( TransactionCompletedEvent ) ;
952+ _transactionCompletedEventHandler ??= new TransactionCompletedEventHandler ( TransactionCompletedEvent ) ;
953953 transaction . TransactionCompleted += _transactionCompletedEventHandler ;
954954 }
955955
0 commit comments