0

I am running my spring application on tomcat7. I use java7, and jtds1.3.1.

I am using sqlserver2014, and the instance is running on a separate machine.

Sometimes, when i run queries through my application, a simple select query (no joins, literally just a select) that takes 1 second if I run it through SQL Server Management Studio, will take 20 minutes or more to complete.

If i check the query on the the sqlserver instance, I see that the total elapsed time keeps incrementing, but the cpu time never increases. Also the status of the query always seems to be 'sleeping'.

I know this is most likely not a problem with SQL Server, as the exact same query finishes instantly when run through SQL Server Management Studio. The fact that the query status seems to constantly be "sleeping" always makes me suspect this.

But beyond this i have no idea how to try and debug what is going on here. Is there anything I can try to change that might help with this issue?

3
  • Did you check your pooled connections? As a try you can completely shutdown the sql server instance and all SQL Server related services. Then start your instance again and try to run your queries. There should be now a noticeable difference. And you have a hint what to look after ...
    – Dimi Takis
    Aug 30, 2019 at 17:56
  • I have tried multiple different server instances (even on different machines), and multiple different models. It seems to be something within my application but i can't figure out whether it is tomcat or something else Aug 30, 2019 at 18:05
  • oh well, then it is somehow useless - leads to just wild guessing - sorry m8
    – Dimi Takis
    Sep 5, 2019 at 10:44

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.