docusign-esign-java-client
docusign-esign-java-client copied to clipboard
Thread Safety - either fix or document
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
Thank you, we have filed DCM-3629 to solve this problem and it is in high priority bucket.