Hi there,
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:
Code:
2017-06-17 19:04:56,621 INFO org.hibernate.engine.internal.StatisticalLoggingSessionEventListener.end - Session Metrics {
1591683 nanoseconds spent acquiring 9 JDBC connections;
1073951 nanoseconds spent releasing 8 JDBC connections;
1173965 nanoseconds spent preparing 10 JDBC statements;
6098889 nanoseconds spent executing 10 JDBC statements;
0 nanoseconds spent executing 0 JDBC batches;
0 nanoseconds spent performing 0 L2C puts;
0 nanoseconds spent performing 0 L2C hits;
0 nanoseconds spent performing 0 L2C misses;
100987632 nanoseconds spent executing 7 flushes (flushing a total of 413 entities and 1445 collections);
95887194 nanoseconds spent executing 3 partial-flushes (flushing a total of 130 entities and 130 collections)
}
However, after this (session is ended), it also shows about 20-40 empty sessions like this:
Code:
2017-06-17 19:04:56,873 INFO org.hibernate.engine.internal.StatisticalLoggingSessionEventListener.end - Session Metrics {
0 nanoseconds spent acquiring 0 JDBC connections;
0 nanoseconds spent releasing 0 JDBC connections;
0 nanoseconds spent preparing 0 JDBC statements;
0 nanoseconds spent executing 0 JDBC statements;
0 nanoseconds spent executing 0 JDBC batches;
0 nanoseconds spent performing 0 L2C puts;
0 nanoseconds spent performing 0 L2C hits;
0 nanoseconds spent performing 0 L2C misses;
0 nanoseconds spent executing 0 flushes (flushing a total of 0 entities and 0 collections);
0 nanoseconds spent executing 0 partial-flushes (flushing a total of 0 entities and 0 collections)
}
Does anyone know if this is normal?