Did you ever ask yourself why a server request took ages on the production system while your local test system was just fine?
Well, we all had these situations and we will have several more of them in the future. In my experience, strange performance drops are often related to slow database queries. But which query causes the problem? And how to find it, if you can't or don't want to activate logging on your database?
The good news is, there is an easy way to do it. Hibernate can be configured to collect statistics and to provide the required information to analyze the database queries. So lets see what we need to do.