High-Performance Java Persistence Newsletter, Issue 35
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
The pick of this edition is this article that goes through a PostgreSQL query optimization. When it comes to improving performance, the execution plan provides a lot of info about what happens behind the scenes so that we can focus on the execution parts that take the most amount of resources.
Handling time zones is very challenging when implementing a web application, so, for this reason, I decided to write this article, in which I provide a step-by-step guide to handling time zones, from the DB to the browser. This article is based on the development I did for my latest project, RevoGain.
A great read is this one explaining why N+1 queries are not a problem for SQLite. When doing performance tuning, it’s very important to know the capabilities and limitations of the underlying stack, as otherwise, you’d only make guesses about what’s needed to be done to speed up your database.
Spring Boot is the most widely used Java web application framework, and knowing how to handle transactions is very important when it comes to both data integrity and application performance. Therefore, to help you tackle this subject, I wrote this article that explains what’s the best way to use the @Transactional
annotation.
Another very good article is this one that demonstrates why you need to use the BUFFERS
option when running an EXPLAIN ANALYZE
query on PostgreSQL.
A lesser-known feature of JPA is related to correlated subqueries. In this article, you are going to learn how to use EXISTS subqueries with JPQL, Criteria API, and Blaze Persistence.
Best Tweets
Here are the best tweets I posted since the last newsletter:
I've been writing one article per week over the past 8 years. Here's why:
— Vlad Mihalcea (@vlad_mihalcea) January 19, 2022
- Writing helps me practice my English skills
- Writing allows me to deep-dive into topics I'm interested in
- Sharing is caring
- Getting exposure may provide you with unexpected business opportunities
People who complain about ORM doing too much Magic are very happy with all the Magic the DB does for them when executing an SQL query.
— Vlad Mihalcea (@vlad_mihalcea) January 31, 2022
Abstractions are very useful, and convenience always wins in the long run!
Teaching is the best way to learn.
— Vlad Mihalcea (@vlad_mihalcea) February 1, 2022
The Scroll Of Truth! pic.twitter.com/k03zCCZYmp
— Vlad Mihalcea (@vlad_mihalcea) January 21, 2022
So easy! pic.twitter.com/dGx3C3FzE1
— Vlad Mihalcea (@vlad_mihalcea) January 17, 2022
New High-Performance SQL Course Module
I managed to edit the Derived Table and CTE module of the High-Performance SQL video course, and I’m now editing the one about JOINs.
When I finish the JOINs module, I’ll release the first edition of the High-Performance SQL video course, which is going to comprise over 4 hours of video course lessons that will surely help you get the most out of your database.
Project Releases
I’m very proud to announce to you that I managed to release the 2.5 version of the amazing Hypersistence Optimizer. Check out the release notes if you want to know what you are missing in case you are using this project-saving tool.
MySQL 8.0.28 has been released, fixing several issues and providing some enhancements to the query optimizer.
The MySQL JDBC Driver released the 8.0.28 version, adding support for multifactor authentication and fixing several issues.
The 42.3.2 version of the PostgreSQL JDBC Driver was released, and it provides a security fix, so you should really consider upgrading.
The 10.2 version of the SQL Server JDBC Driver was released, adding support for Java 17 and connection fault tolerance. Starting with this version, TLS encryption is enabled by default.
The Hibernate team released several versions of their popular data access frameworks:
- Hibernate ORM 6.0.0 CR1 has been released, bringing it closer and closer to the Final 6.0.0 version. What’s exciting about this release is that the User Guide was updated to reflect the changes brought to you by the 6.0 version.
- Hibernate ORM 5.6.5 addresses some H2 database security issues.
- Hibernate ORM 5.6.4 limits JNDI lookups to the ‘java’ scheme and addresses some backward incompatibility issues.

Get in touch with my latest articles!
StackOverflow Answers
The following StackOverflow answers have been trending since the last newsletter episode:
- How to persist a Hibernate child entity without loading the parent-side Set collection
- How to avoid the
java.util.ConcurrentModificationException
in entity merging in JPA and Hibernate - How to log the start and the completion of DB transactions in Hibernate
- How to implement a custom
String
sequence identifier generator with Hibernate - How to map the PostgreSQL Interval column type in Hibernate?