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

Sync similar elements of SqlBulkCopy #881

Merged
merged 1 commit into from
Feb 24, 2021

Conversation

Wraith2
Copy link
Contributor

@Wraith2 Wraith2 commented Jan 15, 2021

Another single file change to sync up unimportant changes and do some cleanup so that real differences can be seen.

I included two minor changes.

  1. changed the SqlRowsCopied event from using a mateialized backing field and custom add/remove handlers to an auto generated event. I did this because no extra functionality was added by the manual versions and the codegen by the compiler is now safer than the .net 1.0 era manual version, compare manual auto
  2. removed a this(,,,) ctor call in netfx (Was already removed in netcore) because it was duplicating work done in the ctor body meaning that the only extra work was to create a connection object which was immediately overwritten.

One question has arisen from this set of changes. Why does netfx use a connectionToDoom parameter when setting up async continuations? Netcore doesn't do it but I don't know if this is because netcore had it removed or netfx had it added after the branch for netcore.

@cheenamalhotra cheenamalhotra added this to the 3.0.0-preview1 milestone Jan 16, 2021
@cheenamalhotra
Copy link
Member

cheenamalhotra commented Jan 18, 2021

One question has arisen from this set of changes. Why does netfx use a connectionToDoom parameter when setting up async continuations? Netcore doesn't do it but I don't know if this is because netcore had it removed or netfx had it added after the branch for netcore.

That's a good observation. The connectionToDoom flow does seem peculiar, and it seems the connection reference is passed over to async tasks to handle events of Out Of Memory, Stack Overflow, Thread Aborted Exceptions in SqlUtil.cs. I think the goal would have been to cleanup server connections in such cases, and prevent them from pooling.

On the other hand in .NET Core, we simply set Exception on TaskCompletionSource (maybe somewhere else it's handled?).
I think we should study this difference carefully to understand if we are cleaning them properly in NetCore too.

cc @saurabh500 who might be able to answer thought behind this difference, and whether this was a conscious decision.

@cheenamalhotra cheenamalhotra merged commit 21804d9 into dotnet:master Feb 24, 2021
@Wraith2 Wraith2 deleted the combine14 branch February 24, 2021 20:20
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