High-Performance Java Persistence Newsletter, Issue 13
Imagine having a tool that can automatically detect JPA and Hibernate performance issues. Hypersistence Optimizer is that tool!
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.
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,
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.
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.
The online workshop I gave about The best way to map entities with JPA and Hibernate has been recorded and is available on Teachable.
This online workshop will help you understand what you need o take into consideration when designing your JPA and Hibernate entities so that your application works as fast as possible.
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
INET 6 column types,
JSON_OBJECTAGG functions, and improving the performance of the InnoDB engine.
If you like this newsletter,
you are going to love the next episodes!
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
- 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