ServiceChannel error under heavy load with single user

We are creating multiple complex jobs from a third party configurator. Currently a custom client app is creating the jobs. Jobs can be created consistently and reliably in a single thread, when increasing it to multiple threads and multiple Epicor sessions we start getting Cannot access a disposed object on the System.ServiceModel.Channels.SerivceChannel.


The error doesn’t throw in a consistent place or after a consistent time. It appears that if if I run each thread/session as a separate Epicor user the issue goes away. I came across the separate user idea since when one of the threads would error with the service channel error the remaining threads would error immediately after with a duplicate entry error. The duplicate entry errors never seemed to be valid based on the state of the job.

There was an earlier post on pushing Epicor hard with DMT and getting a service channel error.
Any thoughts or insights?

On Page 4 of the 10.1.000 Timeout settings document it specifically mentions this error. I’m not sure that this might apply to 10.2, but I’m guessing it might. I hope so because this problem has been dogging my DMT imports for ages. Comments @Bart_Elia, @aidacra ?

Are you using wcf / client proxies to communicate with the app server?
You have to be extremely careful with wcf when it comes to multiple threads. Best to move to rest in those scenarios. Much easier to avoid some of the advanced gymnastics issues with wcf. The caching done in E10 proxies and wcf itself do a ton of caching to maintain a client to server connection. Great for single threaded performance but not for multithreaded. In task agent for example we disable all caching in the client proxy for that reason. Not at keyboard but if you look at the impl classes and the implfactory, you will see a cache flag. Turn off in multithreaded scenarios