Pregunta

I have an java application that interacts with Salesforce. Application processes a batch of requests (~100 requests). Before starting processing of each batch, it calls login() to Salesforce but it never calls logOut() from it in the end. Same cycle happens with next batch. Problem we are facing is, time it takes for a query to return result from Salesforce keeps on increasing until we restart the whole application. After which, query time significantly drops.

My questions are:

  1. Could it be due to repeated logins and never logging out?
  2. I have experimented with logout. It seems, no matter which host I login from, If once logged in, Salesforce always returns same sessionId. That means, if I logout on one host, it logs out on all hosts. That would require us to put logic to handle such unexpected situations on other hosts. How do other people manage session among multiple hosts?

Appreciate any inputs.

¿Fue útil?

Solución

I want to post my findings here. It seems that slow down in queries was due to frequent repeated logins. In my case it was once every 5 mins. Recently logic was changed to login only once and handle any exception that might arise out of session time out/re login if required etc. After this change now, our queries are taking same time and don't slow down.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top