Avoid using Set for bidirectional JPA OneToMany collections

Introduction In this article, we are going to see why there is no benefit in using the Set collection type when mapping a bidirectional JPA OneToMany association. While the @OneToMany annotation can be used to map both unidirectional and bidirectional associations, as I explained this article, you should avoid the unidirectional mapping since it can lead to very inefficient SQL statements.

JTA Transaction Type

Introduction In this article, we are going to analyze how the JTA transaction type works. Since this is the default transaction type when using Jakarta EE or Java EE applications, it’s very important to understand how JTA transactions work, especially since Spring Boot or Spring applications use RESOURCE_LOCAL transactions instead.

The best way to determine the optimal connection pool size

Introduction In this article, we are going to see the best way to determine the optimal connection pool size using the FlexyPool auto-incrementing pool strategy. If you are unfamiliar with the reason why database applications need a connection pool, then check out this article first. Now, according to the Universal Scalability Law, the maximum throughput of a database system is achieved for a limited number of database connections. If we increase the number of connections above that particular number, the throughput will get worse. So, with that in mind, our goal is… Read More

High-Performance Java Persistence Newsletter, Issue 68

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.