High-Performance Java Persistence Newsletter, Issue 22
Imagine having a tool that can automatically detect JPA and Hibernate performance issues. Wouldn’t that be just awesome?
Well, Hypersistence Optimizer is that tool! And it works with Spring Boot, Spring Framework, Jakarta EE, Java EE, Quarkus, or Play Framework.
So, enjoy spending your time on the things you love rather than fixing performance issues in your production system on a Saturday night!
Introduction
Welcome to a new issue of the High-Performance Java Persistence Newsletter in which we share articles, videos, workshops, and StackOverflow answers that are very relevant to any developer who interacts with a database system using Java.
Articles
From version 2.12, Percona PMM uses Victoria Metrics instead of Prometheus. Victoria Metrics provides better disk I/0 utilization and less memory usage. For more details about this change and its benefits, check out this article.
By default, the MySQL JDBC Driver only emulates prepared statements. If you wonder whether server-side prepared statements perform better than client-side ones, then this article explains how to configure the useServerPrepStmts
and cachePrepStmts
settings.
If you’re wondering how to configure PostgreSQL, then there’s this postgresqlco.nf
online service that can help you to achieve this goal.
One lesser-known SQL feature is LATERAL JOIN
that allows you to encapsulate a given computation in a subquery and reuse it in the outer query. For more details about LATERAL JOIN
, check out this article.
If you’re using PostgreSQL, then this list of 60 tools will surely help you identify new applications you could use to get the most out of PostgreSQL.
While it’s a good idea to design the database schema according to the relational model, there are also situations when the relational model is way too strict, so a JSON column type becomes a very handy alternative. For more details about how you can query JSON columns with PostgreSQL, check out this article.
Best Tweets
Here are the best tweets I posted since the last newsletter:
The 8-hour sleep the best debugger.
— Vlad Mihalcea (@vlad_mihalcea) December 7, 2020
COBOL developer when reading that COBOL is a dead language.https://t.co/EKdm8KNeQ5 pic.twitter.com/LgI7Sn3m5e
— Vlad Mihalcea (@vlad_mihalcea) December 20, 2020
Don't feel bad if your application fails sometimes.
— Vlad Mihalcea (@vlad_mihalcea) December 14, 2020
It can happen to @Google too. pic.twitter.com/5oFegAlZnx
I don't always write software, but when I do I use TDD - Tears-Driven Development. pic.twitter.com/xysIkULkuu
— Vlad Mihalcea (@vlad_mihalcea) December 9, 2020
Protip: Be the developer you always wanted to have in your team.
— Vlad Mihalcea (@vlad_mihalcea) December 13, 2020
Project Releases
Hibernate Reactive has been released, offering a Reactive API for the Hibernate ORM project. For more details about this project, check out this article.
The 2.10.1 version of the Hibernate Types project has been released and brings several enhancements that make it worth for you to upgrade. For more details about this release, check out this GitHub milestone.
Hibernate ORM released the 5.4.25 version that fixes several issues.

Get in touch with my latest articles!
StackOverflow Answers
The following StackOverflow answers have been trending over the past two weeks:
- Why does Hibernate execute multiple SELECT queries instead of one when using
@Fetch(FetchMode.JOIN)
- Do you need a database transaction for reading data?
- When are connections returned to the connection pool with Spring JPA (Hibernate) Entity Manager?
- How to fix the Hibernate “object references an unsaved transient instance – save the transient instance before flushing” error
- What’s the Hi/Lo algorithm?
- Hibernate
@Version does
not work with a one-to-many association