Spring Hibernate statistics shows tons of empty sessions
posted 1 month ago
I am using Hibernate 5 with Spring API. Running Java 8 with apache tomcat9. Mysql 5.x
I access objects using getSession().getCurrentSession(), and only have one spring session per request. (happy to paste my struts action, but not sure if it would help).
I enabled stat logging, and it displays all the queries, and session statistics at the end.
So I would see a bunch of queries and then this:
However, after this (session is ended), it also shows about 20-40 empty sessions like this: