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

Unable to view SQL on SQL Tab when using transactions #772

Closed
AdamDowns opened this Issue Mar 31, 2014 · 22 comments

Comments

Projects
None yet
10 participants
@AdamDowns

When wrapping the DB context with a transaction per request the SQL tab will not show SQL and throws:

System.NullReferenceException: Object reference not set to an instance of an object. at Glimpse.Ado.Model.ConnectionMetadata.RegiserTransactionStart(TransactionMetadata transaction) at
Glimpse.Ado.Model.MessageAggregator.AggregateTransactionBegan() at 
Glimpse.Ado.Model.MessageAggregator.Aggregate() at Glimpse.Ado.Tab.SQL.GetData(ITabContext context) at 
Glimpse.Core.Framework.GlimpseRuntime.ExecuteTabs(RuntimeEvent runtimeEvent)

If I comment out the transaction.BeginTransaction() and the Commit. then the SQL Tab displays fine.

I am using MVC5 and EF 6.0.2 and wrap my requests like the following

on Application_BeginRequest I create a transaction and put it in the HttpContext Items collection

on Application_EndRequest I look for any errors and commit or roll back the transaction

@youfoundkris

This comment has been minimized.

Show comment
Hide comment
@youfoundkris

youfoundkris Apr 10, 2014

I get a similar exception! In my situation there is no command in the Commands structure.

I get a similar exception! In my situation there is no command in the Commands structure.

@avanderhoorn

This comment has been minimized.

Show comment
Hide comment
@avanderhoorn

avanderhoorn Apr 29, 2014

Member

I'm going to look into this, but just to make sure, are you able to update to all the latest packages and make sure that the issue still exists?

Member

avanderhoorn commented Apr 29, 2014

I'm going to look into this, but just to make sure, are you able to update to all the latest packages and make sure that the issue still exists?

@vadimi

This comment has been minimized.

Show comment
Hide comment
@vadimi

vadimi Jul 1, 2014

I just was able to reproduce this issue. The error happens in ConnectionMetadata class in RegiserTransactionStart method when Commands dictionary is empty. Simple null check helps:

var command = Commands.FirstOrDefault(x => x.Value.Offset >= transaction.Offset);
if (command.Value != null)
{
    command.Value.HeadTransaction = transaction;
}

vadimi commented Jul 1, 2014

I just was able to reproduce this issue. The error happens in ConnectionMetadata class in RegiserTransactionStart method when Commands dictionary is empty. Simple null check helps:

var command = Commands.FirstOrDefault(x => x.Value.Offset >= transaction.Offset);
if (command.Value != null)
{
    command.Value.HeadTransaction = transaction;
}
@avanderhoorn

This comment has been minimized.

Show comment
Hide comment
@avanderhoorn

avanderhoorn Jul 2, 2014

Member

Arr makes sense... under what case would you have a transaction but no commands? I guess maybe if you start a transaction but the logic path in a given case avoids creating any commands?

Member

avanderhoorn commented Jul 2, 2014

Arr makes sense... under what case would you have a transaction but no commands? I guess maybe if you start a transaction but the logic path in a given case avoids creating any commands?

@vadimi

This comment has been minimized.

Show comment
Hide comment
@vadimi

vadimi Jul 2, 2014

Yes, I have a scenario when there are no db queries at all on several pages, but I use one transaction per request anyways.

vadimi commented Jul 2, 2014

Yes, I have a scenario when there are no db queries at all on several pages, but I use one transaction per request anyways.

@robdmoore

This comment has been minimized.

Show comment
Hide comment
@robdmoore

robdmoore Nov 10, 2014

Any eta on when this might be fixed?

Thanks

Any eta on when this might be fixed?

Thanks

@avanderhoorn

This comment has been minimized.

Show comment
Hide comment
@avanderhoorn

avanderhoorn Nov 19, 2014

Member

@robdmoore Thanks for the poke. Currently working on some other bits at the moment. As pointed out the fix is quite simple, would you like to give it a go and send it in as a PR?

Member

avanderhoorn commented Nov 19, 2014

@robdmoore Thanks for the poke. Currently working on some other bits at the moment. As pointed out the fix is quite simple, would you like to give it a go and send it in as a PR?

@robdmoore

This comment has been minimized.

Show comment
Hide comment
@robdmoore

robdmoore Dec 28, 2014

Sorry, I've been flat out. Will do if I get a chance, not likely for a while though sorry.

Sorry, I've been flat out. Will do if I get a chance, not likely for a while though sorry.

@avanderhoorn avanderhoorn added this to the vNext milestone Jan 16, 2015

@avanderhoorn

This comment has been minimized.

Show comment
Hide comment
@avanderhoorn

avanderhoorn Jan 16, 2015

Member

@robdmoore would be great if you can give it a crack, would love to get the fix into the next release.

Member

avanderhoorn commented Jan 16, 2015

@robdmoore would be great if you can give it a crack, would love to get the fix into the next release.

@robdmoore

This comment has been minimized.

Show comment
Hide comment
@robdmoore

robdmoore Jan 17, 2015

Nice - looks like someone else did this :)

When is the next release coming out?

Thanks mate

Nice - looks like someone else did this :)

When is the next release coming out?

Thanks mate

@NotMyself

This comment has been minimized.

Show comment
Hide comment
@NotMyself

NotMyself Apr 15, 2015

Looks like I just ran into this bug with version 1.7.3. Has 1.7.4 shipped yet? or soon?

Looks like I just ran into this bug with version 1.7.3. Has 1.7.4 shipped yet? or soon?

@avanderhoorn

This comment has been minimized.

Show comment
Hide comment
@avanderhoorn

avanderhoorn Apr 23, 2015

Member

I'm going to try and get a release out early next week.

Member

avanderhoorn commented Apr 23, 2015

I'm going to try and get a release out early next week.

@avanderhoorn

This comment has been minimized.

Show comment
Hide comment
@avanderhoorn

avanderhoorn May 6, 2015

Member

This is just waiting on one feature (keyboard shortcuts) to get in and then we will release.

Member

avanderhoorn commented May 6, 2015

This is just waiting on one feature (keyboard shortcuts) to get in and then we will release.

@NotMyself

This comment has been minimized.

Show comment
Hide comment

any updates @avanderhoorn ?

@NotMyself

This comment has been minimized.

Show comment
Hide comment

Any updates @avanderhoorn ?

@avanderhoorn

This comment has been minimized.

Show comment
Hide comment
@avanderhoorn

avanderhoorn Nov 18, 2015

Member

@NotMyself Thanks for pining me. Let me sync with the rest of the team and I'll get back to you next week.

Member

avanderhoorn commented Nov 18, 2015

@NotMyself Thanks for pining me. Let me sync with the rest of the team and I'll get back to you next week.

@NotMyself

This comment has been minimized.

Show comment
Hide comment
@kedde

This comment has been minimized.

Show comment
Hide comment
@kedde

kedde Feb 1, 2016

Have 1.7.4 been released on nuget? Or will this issue only be addressed in asp.net core version? I'll see the vNext Milestone tag.

kedde commented Feb 1, 2016

Have 1.7.4 been released on nuget? Or will this issue only be addressed in asp.net core version? I'll see the vNext Milestone tag.

@jusefb

This comment has been minimized.

Show comment
Hide comment
@jusefb

jusefb Apr 19, 2016

Hi,

Will this be fixed any time soon?

jusefb commented Apr 19, 2016

Hi,

Will this be fixed any time soon?

@feitzi

This comment has been minimized.

Show comment
Hide comment
@feitzi

feitzi Sep 21, 2016

Why is this issue closed? There is now version released that fix this bug. Please release 1.7.4

feitzi commented Sep 21, 2016

Why is this issue closed? There is now version released that fix this bug. Please release 1.7.4

@JesseKlaasse

This comment has been minimized.

Show comment
Hide comment
@JesseKlaasse

JesseKlaasse Apr 3, 2017

As far as I can see, Glimpse.Ado is still @ 1.7.3, and still contains the bug in this issue. Is there any news on this?

As far as I can see, Glimpse.Ado is still @ 1.7.3, and still contains the bug in this issue. Is there any news on this?

@NotMyself

This comment has been minimized.

Show comment
Hide comment
@NotMyself

NotMyself Apr 3, 2017

@JesseKlaasse for whatever reason the fix was never released to nuget and this issue was closed was closed without comment after months of ignoring the issue. Not much has happened here since @avanderhoorn was hired by microsoft.

@JesseKlaasse for whatever reason the fix was never released to nuget and this issue was closed was closed without comment after months of ignoring the issue. Not much has happened here since @avanderhoorn was hired by microsoft.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment