function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
rtompkinsrtompkins 

SoapBindingStubs and connection limits

I have a question about the reuse of SoapBindingStubs?

 We have an integration in our webapp that allows users of our web app to search the salesforce contacts database.
Because there are multiple users of our system there could be ten or more people querying Salesforce at the same time. In my current code I am creating a single login sessions and a single SoapBindingStub.The binding is then  shared  between the users querying salesforce. I.E all queries are made via the same username/password, and the same SoapBindingStub.

Is this a bad idea?

Will the queries get blocked, and run one at a time , instead of all running simultaneously?


Should I be creating one login sessions, and then recreating the binding for each query, as was suggested in another thread?





SuperfellSuperfell
Typically the bindingstubs are not threadsafe, so you're playing with fire by using the same instance of the stub concurrently on multiple threads. Just share the sessionId/serverUrl info, and have each thread create/configure its own stub.