How to avoid the Hibernate Query Cache N+1 issue

Introduction I recently answered this question on the Hibernate forum, and since it’s a very good one, I decided to turn it into an article. In this post, we will describe how the N+1 query issue is generated when using the second-level Hibernate Query Cache.

9 High-Performance Tips when using PostgreSQL with JPA and Hibernate

Introduction To get the most out of the relational database in use, you need to make sure the data access layer resonates with the underlying database system. In this article, we are going to see what you can do to boost up performance when using PostgreSQL with JPA and Hibernate.

PostgreSQL reWriteBatchedInserts configuration property

Introduction The PostgreSQL JDBC Driver has been adding a lot of very useful optimizations, and one of the lesser-known ones is the reWriteBatchedInserts configuration property. In this article, you will see how the reWriteBatchedInserts JDBC configuration property works in PostgreSQL, and how it allows you to rewrite INSERT statements into a multi-VALUE INSERT.

How to map an immutable entity with JPA and Hibernate

Introduction In this article, you are going to find out how to map an immutable entity when using JPA and Hibernate. If your Domain Model requires that a given entity should not be modified by the data access logic, Hibernate can enforce this requirement if the entity is marked with the @Immutable annotation.