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

Thread Safety - either fix or document #123

Open
newcron opened this issue Oct 9, 2019 · 2 comments
Open

Thread Safety - either fix or document #123

newcron opened this issue Oct 9, 2019 · 2 comments

Comments

@newcron
Copy link

newcron commented Oct 9, 2019

Hi Everyone,

I came to notice, that the current Java Client is not thread safe for a couple of reasons:

  • It uses classes that do not support concurrency and yield incorrect results when accessed by multiple threads like HashMap (explanation here)and SimpleDateFormat (explanation here)
  • The results of the last API call are stored in fields inside ApiClient (statusCode and responseHeaders) - which might be overridden by a concurrent request. Accessing that information from the outside may cause incorrect results

I understand that fixing these issues may introduce breaking changes (although using ThreadLocal might be a replacement for statusCode and responseHeader fields) and might not be something to be considered now.

However, I would ask you to at least document the concurrency based limitations of the API client and point out the best way to use the client in a concurrent setup, like a web application.

Thanks a lot

@LarryKlugerDS
Copy link
Contributor

Thank you, we have filed DCM-3629 to solve this problem and it is in high priority bucket.

@vinz
Copy link
Contributor

vinz commented Jul 30, 2024

Hi @newcron ,

Thank you for highlighting these concurrency issues and for your patience.

We apologize for the delay in addressing this issue. Our team had updated the documentation back in March 2022, but updating this GitHub issue got missed.

Here is the details on how to use Docusign Java SDK in multithreaded environments:
https://developers.docusign.com/docs/esign-rest-api/sdks/java/setup-and-configuration/

multi-threaded support

I hope this helps clarify on this topic.

Feel free to give it a try and confirm here so that we can close the issue.

Thank you,
Vinay C

@vinz vinz added the resolved label Jul 30, 2024
@vinz vinz self-assigned this Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants