Fix #737 - Loosen GetDbProviderManifestToken behavior #836

Merged
merged 1 commit into from Sep 9, 2014

Projects

None yet

3 participants

@jasonkenneth

Convert the cast to an 'as'. Seems reasonable to not cause the
application fail due to a bad interaction in what seems to be a lifetime
issue. Could also log a warning should you want to track this unexpected
case.

@jasonkenneth jasonkenneth Fix #737 - Loosen GetDbProviderManifestToken behavior
Convert the cast to an 'as'. Seems reasonable to not cause the
application fail due to a bad interaction in what seems to be a lifetime
issue. Could also log a warning should you want to track this unexpected
case.
af3fa7b
@jasonkenneth
Owner

This fixes this issue for me. I didn't look deeply into general Glimpse behavior or possible underlying issues. Also wanted experience creating a pull request. :)

@nikmd23
Member
nikmd23 commented Sep 2, 2014

I'm going to let @avanderhoorn take a look at this one.

@avanderhoorn
Member

I'm happy to pull this in. My one question, which is more about the initial bug, is why would a "non glimpse" connection be running through this code path? Are you creating your connections in a particular way?

@jasonkenneth

The Asp.net MVC5 project hosts a couple of wcf services as well; during a wcf call is typically when this issue occurs. Ahh, but typically during those calls, I'm using the new EF6 transaction syntax to share a connection between different DbContexts. In that code, I'm using the SqlConnection creation syntax per the example in the below link:

Working with Transactions (EF6 Onwards)

static void UsingExternalTransaction() 
{ 
    using (var conn = new SqlConnection("...")) 
    { 
        conn.Open(); 
        using (var sqlTxn = conn.BeginTransaction(System.Data.IsolationLevel.Snapshot)) 
        ...
    }
}
@avanderhoorn
Member

@jasonkenneth So you are manually creating your own connections, commands and transactions?

@jasonkenneth

In the few cases where I need transactions that cross multiple DbContexts, I create the connection and transaction manually. In the remaining cases, EF creates everything automatically. Each DbContext represents a different schema in the SqlServer database.

So the order that I encountered this issue was that I had everything working well with just the standard EF. Then I had to implement a case where I implemented my own connection according to that EF6 example and my app broke.

@avanderhoorn
Member

Arr ok makes sense now. Pulling in. Thanks for the patch.

@avanderhoorn avanderhoorn merged commit 9114f66 into Glimpse:master Sep 9, 2014
@avanderhoorn avanderhoorn added this to the vNext milestone Sep 9, 2014
@avanderhoorn avanderhoorn self-assigned this Sep 9, 2014
@jasonkenneth

Cheers!

On Tue, Sep 9, 2014 at 3:03 PM, Anthony van der Hoorn <
notifications@github.com> wrote:

Arr ok makes sense now. Pulling in. Thanks for the patch.


Reply to this email directly or view it on GitHub
#836 (comment).

@jasonkenneth

Will do.

On Tue, Sep 9, 2014 at 3:05 PM, Anthony van der Hoorn <
notifications@github.com> wrote:

Also when you get a chance can you sign this and send it in -
https://www.dropbox.com/s/z9abe8y9mr7r7rv/Glimpse%20Project%20Individual%20Contributor%20License%20Agreement.docx?dl=0.
Cheers!


Reply to this email directly or view it on GitHub
#836 (comment).

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