Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#7105 Trace when query is done. This is needed in order to get Select… #7106

Merged
merged 1 commit into from
Nov 30, 2016

Conversation

fitzchak
Copy link

Fix #7105

@dnfclas
Copy link

dnfclas commented Nov 23, 2016

Hi @fitzchak, I'm your friendly neighborhood .NET Foundation Pull Request Bot (You can call me DNFBOT). Thanks for your contribution!
You've already signed the contribution license agreement. Thanks!

The agreement was validated by .NET Foundation and real humans are currently evaluating your PR.

TTYL, DNFBOT;

@fitzchak
Copy link
Author

fitzchak commented Nov 29, 2016

@anpete I applied requested changes.

public RelationalDataReader(
[CanBeNull] IRelationalConnection connection,
[NotNull] DbCommand command,
[NotNull] DbDataReader reader)
[NotNull] DbDataReader reader,
[NotNull] DiagnosticSource diagnosticSource)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add Check.NotNull

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -226,7 +226,7 @@ object IRelationalCommand.ExecuteScalar(IRelationalConnection connection, IReadO
= new RelationalDataReader(
connection,
dbCommand,
dbCommand.ExecuteReader());
dbCommand.ExecuteReader(), DiagnosticSource);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move arg to newline.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -65,6 +71,7 @@ public virtual void Dispose()
{
if (!_disposed)
{
_diagnosticSource.WriteDataReaderDisposed(this);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we are firing the event before disposing the underlying reader, which is probably more useful anyway. I think we should tweak the event name to reflect that. I.e. "Disposing" instead of "Disposed".

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you actually need the reader instance for your use case?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we need it before the disposing. So I changed the name to "Disposing".
Also we need just the instance of DbDataReader, which has the command with the statistics and the connection. So I changed this also to send just the DbDataReader.

…SelectRows statistics. Take dotnet#2: Use the DiagnosticSource on RelationalDataReader. Take dotnet#3: Fix requested changes.
@fitzchak
Copy link
Author

I amended the commit with the requested changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants