High-Performance Java Persistence Newsletter, Issue 13
Are you struggling with performance issues in your Spring, Jakarta EE, or Java EE application?
Imagine having a tool that could automatically detect performance issues in your JPA and Hibernate data access layer long before pushing a problematic change into production!
With the widespread adoption of AI agents generating code in a heartbeat, having such a tool that can watch your back and prevent performance issues during development, long before they affect production systems, can save your company a lot of money and make you a hero!
Hypersistence Optimizer is that tool, and it works with Spring Boot, Spring Framework, Jakarta EE, Java EE, Quarkus, Micronaut, or Play Framework.
So, rather than allowing performance issues to annoy your customers, you are better off preventing those issues using Hypersistence Optimizer and enjoying spending your time on the things that you love!
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 newsletter is this article written on the Persona’s blog about identifying long-running MySQL queries using either the Percona Monitoring and Management
tool or the MySQL Slow Query Log.
The only constant in software is change, and database schemas are no different. To migrate the database schema from one version to another, you are better off using incremental migration scripts that are applied automatically by migration tool, like Flyway. This article explains in great detail how Flyway works and why you should definitely use it.
As I already explained, adding a query timeout threshold is a very good idea since it allows you to roll back long-running transactions that could hurt application performance by preventing the VACCUM process from cleaning up dead tuples or lowering the transaction identifier to prevent a fatal wraparound. If you are using PostgreSQL, then this article explains how to configure the query timeout threshold using the statement_timeout PostgreSQL configuration.
The Hibernate Types project allows you to map JSON column types to a great variety of JPA entity attribute types, like POJO, String, JsonNode or Map. If you want to store JSON data as a Java Map, this article explains how easily you can achieve this goal using the Hibernate Types open-source project.
Many software developers are familiar with the B+Tree database indexes. However, PostgreSQL supports many other indexing options, like Hash, Gist, Gin, BRIN. For more details about this topic, check out this article.
YouTube Video
I added a new YouTube video about speeding up integration tests using Docker and tmpfs. This video episode is part of my High-Performance Java Persistence video course, so if you like the video, you are going to love the video course even more.
Project Releases
Hibernate ORM 5.4.18 has been released. This release fixes a security issue, so, if you are using Hibernate 5.4, you should definitely upgrade your dependency.
MariaDB 10.5 has been released, adding support for a new ColumnStore, INET 6 column types, JSON_ARRAYAGG and JSON_OBJECTAGG functions, and improving the performance of the InnoDB engine.
Get in touch with my latest articles!
StackOverflow Answers
The following StackOverflow answers have been trending over the past two weeks:
- How to find the SQL statement that throws the Hibernate “Batch update returned unexpected row count from update: 0 actual row count: 0 expected: 1” issue
javax.transaction.Transactionalvs.org.springframework.transaction.annotation.Transactional- How to register Entity Event Listeners with Spring and Hibernate
- Why does not Hibernate set @DynamicInsert by default
- How to combine INNER JOIN and LEFT JOIN with JPQL and HQL

