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

add bulkupdateasync #2655

Conversation

ElizabethOkerio
Copy link
Contributor

@ElizabethOkerio ElizabethOkerio commented Apr 24, 2023

Issues

This PR adds the BulkUpdateAsync method. This method allows users to carry out bulk update requests asynchronously.

The PR uses the FromAsync pattern that is currently supported in OData Client to wrap the BeginBulkUpdate and EndBulkUpdate methods of a BulkUpdate operation.

To the DataServiceContext, I have added the BulkUpdateAsync, BeginBulkUpdate and EndBulkUpdate methods. Within the BulkUpdateAsync method I'm using the FromAsync method to wrap the BeginBulkUpdate and EndBulkUpdate methods.

Description

Briefly describe the changes of this pull request.

Checklist (Uncheck if it is not completed)

  • Test cases added
  • Build and test with one-click build and test script passed

Additional work necessary

If documentation update is needed, please add "Docs Needed" label to the issue and provide details about the required document change in the issue.

@ElizabethOkerio ElizabethOkerio force-pushed the feature/support_bulkupdate_async_apis branch from 6d21e4d to e7c6769 Compare April 24, 2023 10:26
@ElizabethOkerio ElizabethOkerio force-pushed the feature/support_bulkupdate_async_apis branch from 03ea6f1 to 52487c2 Compare April 26, 2023 09:16
@ElizabethOkerio ElizabethOkerio requested review from habbes and xuzhg April 26, 2023 09:18
}
finally
{
this.HandleCompleted(pereq);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is it getting disposed?

I see that we're disposing perReq at some point, but looking at the source code of PerRequest.Dispose(), it doesn't seem to be disposing it's PerRequest.Request object. So it's still not clear to me at what point we're disposing this.bulkUpdateRequestMessage.

@ElizabethOkerio ElizabethOkerio force-pushed the feature/support_bulkupdate_async_apis branch from 77a1b0e to 8b9b30a Compare April 27, 2023 10:52
@ElizabethOkerio ElizabethOkerio requested review from xuzhg and habbes April 27, 2023 12:26
@ElizabethOkerio ElizabethOkerio force-pushed the feature/support_bulkupdate_async_apis branch from c8ddc6f to 7725fb9 Compare April 27, 2023 13:02
}
finally
{
this.HandleCompleted(pereq);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. It's strange that it doesn't implement IDisposable, seems like design flaw. I wonder whether we may have any resource leaks since at least the underlying HttpClientRequestMessage is disposable.

@ElizabethOkerio ElizabethOkerio requested a review from habbes April 28, 2023 07:02
habbes
habbes previously approved these changes Apr 28, 2023
@ElizabethOkerio ElizabethOkerio merged commit 399df92 into OData:master Apr 28, 2023
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.

4 participants