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:
Appreciate any inputs.
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.