-
Notifications
You must be signed in to change notification settings - Fork 286
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
SqlConnection.Clone doesn't copy AccessTokenCallback #2524
Comments
Can you please elaborate further on the issue? please include any repro steps or more explanation |
@kf-gonzalez2 There is a originating issue here: ErikEJ/EntityFramework6PowerTools#147 and a follow up PR for EF 6 here: ErikEJ/EntityFramework6PowerTools#150 - I think this could be "by design" |
FWIW I think the main usefulness in DbConnection.Clone() is precisely to clone the authentication information, so that the clone can actually be opened successfully. For example, the password does get copied to clones, so I'm not sure why AccessTokenCallback would be treated any differently: var connection1 = new SqlConnection("Server=localhost;Database=test;User=SA;Password=Abcd5678;Connect Timeout=60;ConnectRetryCount=0;Encrypt=false");
connection1.Open();
var connection2 = (SqlConnection)((ICloneable)connection1).Clone();
connection2.Open(); |
@roji Thanks for joining! Yeah. could be an oversight - AccessTokenCallback was just added to 5.2. Would be great to get it fixed in SqlClient. so that Microsoft.EntityFramwork.SqlServer could take advantage (by using a newer SqlClient). I think adding the above "fix" to that is out of scope. |
I agree, this seems to be a simple oversight in the original implementation. We should fix this in MDS. |
I'm not sure it's bug or by design, if by design, can you explain why?
The text was updated successfully, but these errors were encountered: