Hi, i have a large application and am currently logging Hibernate statistics for some performance analysis and keep getting the following entry popping up:
2017-02-07 15:10:02,738 [http-nio-8181-exec-2] INFO org.hibernate.engine.internal.StatisticalLoggingSessionEventListener - Session Metrics { 887587 nanoseconds spent acquiring 1 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) }
When certain actions are performed this can appear up to 200 times, where it acquires a connection but no statements or anything are executed. I have one page that shouldn't use Hibernate at all yet when loading up 40 of these log messages appear.
Initially i thought it could be from a lot of @Transactional methods that weren't actually performing any action on the database, but this doesn't appear to be the issue at first glance.
My question is simply what could be causing for all of these log messages to be showing up and what to look for so that i can prevent it, as it is a needless 200ms spent loading certain pages. I have read that it could be something around the connection pooling but my knowledge on this area isn't very good, so any further explanation would be appreciated if this is the issue.
Thanks
|