| When using hibernate in JPA mode with statistics enabled, the session close statistic is not updated. Giving a look in the close() method of SessionImpl
if ( getSessionFactory().getSessionFactoryOptions().isJpaBootstrap() ) {
checkSessionFactoryOpen();
checkOpenOrWaitingForAutoClose();
if ( discardOnClose || !isTransactionInProgress( false ) ) {
super.close();
}
else {
waitingForAutoClose = true;
closed = true;
}
}
else {
super.close();
if ( getFactory().getStatistics().isStatisticsEnabled() ) {
getFactory().getStatistics().closeSession();
}
}
we can see that getFactory().getStatistics().closeSession(); is only called in native mode |