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

Fix #737 - Loosen GetDbProviderManifestToken behavior #836

Merged
merged 1 commit into from Sep 9, 2014

Conversation

Projects
None yet
3 participants
@jasonkenneth

jasonkenneth commented Aug 26, 2014

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.

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.
@jasonkenneth

This comment has been minimized.

Show comment
Hide comment
@jasonkenneth

jasonkenneth Aug 26, 2014

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. :)

Owner

jasonkenneth commented on af3fa7b Aug 26, 2014

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

This comment has been minimized.

Show comment
Hide comment
@nikmd23

nikmd23 Sep 2, 2014

Member

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

Member

nikmd23 commented Sep 2, 2014

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

@avanderhoorn

This comment has been minimized.

Show comment
Hide comment
@avanderhoorn

avanderhoorn Sep 9, 2014

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?

Member

avanderhoorn commented Sep 9, 2014

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

This comment has been minimized.

Show comment
Hide comment
@jasonkenneth

jasonkenneth Sep 9, 2014

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)) 
        ...
    }
}

jasonkenneth commented Sep 9, 2014

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

This comment has been minimized.

Show comment
Hide comment
@avanderhoorn

avanderhoorn Sep 9, 2014

Member

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

Member

avanderhoorn commented Sep 9, 2014

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

@jasonkenneth

This comment has been minimized.

Show comment
Hide comment
@jasonkenneth

jasonkenneth Sep 9, 2014

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.

jasonkenneth commented Sep 9, 2014

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

This comment has been minimized.

Show comment
Hide comment
@avanderhoorn

avanderhoorn Sep 9, 2014

Member

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

Member

avanderhoorn commented Sep 9, 2014

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

avanderhoorn added a commit that referenced this pull request Sep 9, 2014

Merge pull request #836 from jasonkenneth/Fix737
Fix #737 - Loosen GetDbProviderManifestToken behavior

@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

@avanderhoorn

This comment has been minimized.

Show comment
Hide comment
@avanderhoorn
Member

avanderhoorn commented Sep 9, 2014

@jasonkenneth

This comment has been minimized.

Show comment
Hide comment
@jasonkenneth

jasonkenneth Sep 9, 2014

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 commented Sep 9, 2014

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

This comment has been minimized.

Show comment
Hide comment
@jasonkenneth

jasonkenneth Sep 9, 2014

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).

jasonkenneth commented Sep 9, 2014

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