Summary
In this chapter, we discussed the statistics and metrics that Hibernate can collect. We showed how you can configure Hibernate to start collecting this data and how we can get access to this data. This included datasets at the session factory level (for all sessions), including entity, collection, query, and cache metrics. Furthermore, we showed that you can collect statistics for a named entity or query.
We completed this chapter by introducing JMX and showing you how it can be used to monitor the Hibernate statistical data at runtime using a remote client such as jconsole
. We further showed how to utilized Spring for easy integration.
In the next chapter, we'll explore architectural concerns related to enterprise applications and how Hibernate can address these concerns.