
Transactions and Concurrency Control
Posted on December 12, 2024 by vladmihalcea
Are you struggling with performance issues in your Spring, Jakarta EE, or Java EE application?
What if there were a tool that could automatically detect what caused performance issues in your JPA and Hibernate data access layer?
Wouldn’t it be awesome to have such a tool to watch your application and prevent performance issues during development, long before they affect production systems?
Well, 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 fixing performance issues in your production system on a Saturday night, you are better off using Hypersistence Optimizer to help you prevent those issues so that you can spend your time on the things that you love!
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 week is this series of articles from Franck Pachot about Amazon Aurora Limitless, a PostgreSQL-compatible database that provides automatic sharding. While the solution lacks several features, it’s good to keep an eye on it as it may become a valid alternative to Amazon Aurora.
If you are using JPA and Hibernate, then you may wonder what collection type is more convenient for a bidirectional association. You could choose either a List or a Set. If you want to know what is the best collection type in this case, then check out this article.
When using relational database systems, you can speed up SQL statements by using the right indexes. If you are using MySQL and want to learn what is the best way to use indexes, then check out this article.
Speaking of database systems, when using a database connection pool, you need to set the maximum size to a given value. Knowing what is the right maximum size is not a trivial task since a value that’s too low may increase transaction response time while a high value may deprive other services from using some database connections that the application that reserved them might not even use.
If you want to know how you can determine the optimal pool size, check out this article.
JPA provides two transaction types: RESOURCE_LOCAL and JTA. If you want to know how these two transaction types work, then check out these articles:
Another very good article I read was this one about merging individual indexes when executing queries with multiple filtering predicates.
The 3.9 version of Hypersistence Utils has been released and provides support for GraalVM native images.
PostgreSQL released the 17.2 version that provides several bug fixes. If you upgraded to version 17, then you might want to give it a try.
Get in touch with my latest articles!
The following StackOverflow answers have been trending since the last newsletter episode:
Category: Newsletter Tags: hibernate, java, jpa, MySQL, PostgreSQL, SQL
Vlad Mihalcea

Transactions and Concurrency Control