Skip to content

Commit 8bf5ed8

Browse files
committed
Add doc comments.
1 parent 909ee20 commit 8bf5ed8

File tree

5 files changed

+20
-2
lines changed

5 files changed

+20
-2
lines changed

src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlInternalConnectionTds.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,7 @@ protected override void InternalDeactivate()
958958
}
959959
}
960960

961-
[SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters")] // copied from Triaged.cs
961+
/// <inheritdoc/>
962962
internal override void ResetConnection()
963963
{
964964
// For implicit pooled connections, if connection reset behavior is specified,

src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlInternalConnectionTds.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,7 @@ protected override void InternalDeactivate()
966966
}
967967
}
968968

969-
[SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters")] // copied from Triaged.cs
969+
/// <inheritdoc/>
970970
internal override void ResetConnection()
971971
{
972972
// For implicit pooled connections, if connection reset behavior is specified,

src/Microsoft.Data.SqlClient/src/Microsoft/Data/ProviderBase/DbConnectionClosed.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ internal override void CloseConnection(DbConnection owningObject, SqlConnectionF
3333
// not much to do here...
3434
}
3535

36+
/// <inheritdoc/>
3637
protected override void Deactivate() => ADP.ClosedConnectionError();
3738

3839
public override void EnlistTransaction(System.Transactions.Transaction transaction) => throw ADP.ClosedConnectionError();
@@ -56,6 +57,7 @@ internal override bool TryOpenConnection(
5657
DbConnectionOptions userOptions) =>
5758
TryOpenConnectionInternal(outerConnection, connectionFactory, retry, userOptions);
5859

60+
/// <inheritdoc/>
5961
internal override void ResetConnection() => throw ADP.ClosedConnectionError();
6062
}
6163

src/Microsoft.Data.SqlClient/src/Microsoft/Data/ProviderBase/DbConnectionInternal.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -795,6 +795,11 @@ internal void PrePush(DbConnection expectedOwner)
795795
internal void RemoveWeakReference(object value) =>
796796
ReferenceCollection?.Remove(value);
797797

798+
/// <summary>
799+
/// Idempotently resets the connection so that it may be recycled without leaking state.
800+
/// May preserve transaction state if the connection is enlisted in a distributed transaction.
801+
/// Should be called before the first action is taken on a recycled connection.
802+
/// </summary>
798803
internal abstract void ResetConnection();
799804

800805
internal void SetInStasis()
@@ -834,6 +839,11 @@ internal virtual bool TryReplaceConnection(
834839

835840
#region Protected Methods
836841

842+
/// <summary>
843+
/// Activates the connection, preparing it for active use.
844+
/// An activated connection has an owner and is checked out from the connection pool (if pooling is enabled).
845+
/// </summary>
846+
/// <param name="transaction">The transaction in which the connection should enlist.</param>
837847
protected abstract void Activate(Transaction transaction);
838848

839849
/// <summary>
@@ -850,6 +860,11 @@ protected virtual DbReferenceCollection CreateReferenceCollection()
850860
throw ADP.InternalError(ADP.InternalErrorCode.AttemptingToConstructReferenceCollectionOnStaticObject);
851861
}
852862

863+
/// <summary>
864+
/// Deactivates the connection, cleaning up any state as necessary.
865+
/// A deactivated connection is one that is no longer in active use and does not have an owner.
866+
/// A deactivated connection may be open (connected to a server) and is checked into the connection pool (if pooling is enabled).
867+
/// </summary>
853868
protected abstract void Deactivate();
854869

855870
protected internal void DoNotPoolThisConnection()

src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlInternalConnection.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ override protected DbReferenceCollection CreateReferenceCollection()
246246
return new SqlReferenceCollection();
247247
}
248248

249+
/// <inheritdoc/>
249250
override protected void Deactivate()
250251
{
251252
try

0 commit comments

Comments
 (0)