Spring read-only transaction Hibernate optimization

Introduction

In this article, I’m going to explain how the Spring read-only transaction Hibernate optimization works.

After taking a look at what the Spring framework does when enabling the readOnly attribute on the @Transactional annotation, I realized that only the Hibernate flush mode is set to FlushType.MANUAL without propagating the read-only flag further to the Hibernate Session.

So, in the true spirit of open-source software developer, I decided it’s time to make a change.

Continue reading “Spring read-only transaction Hibernate optimization”

Hibernate performance tuning tips

Introduction

In this article, I’m going to summarise the most common Hibernate performance tuning tips that can help you speed up your data access layer.

While getting started with JPA and Hibernate is fairly easy, if you want to get the most out of your data access layer, it’s very important to understand how the JPA provider works, as well as the configuration properties that can help you optimize application performance.

Continue reading “Hibernate performance tuning tips”

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.

Continue reading “9 High-Performance Tips when using PostgreSQL with JPA and Hibernate”

A beginner’s guide to the high-performance-java-persistence GitHub repository

Introduction

When I started writing High-Performance Java Persistence, I realized I needed a GitHub repository to host all the test cases I needed for the code snippets in my book, and that’s how the high-performance-java-persistence GitHub repository was born.

The high-performance-java-persistence GitHub repository is a collection of integration tests and utilities so that you can test JDBC, JPA, Hibernate and jOOQ features with the utmost ease.

Continue reading “A beginner’s guide to the high-performance-java-persistence GitHub repository”

How to run integration tests at warp speed using Docker and tmpfs

Introduction

As previously explained, you can run database integration tests 20 times faster! The trick is to map the data directory in memory, and my previous article showed you what changes you need to do when you have a PostgreSQL or MySQL instance on your machine.

In this post, I’m going to expand the original idea, and show you how you can achieve the same goal using Docker and tmpfs.

Continue reading “How to run integration tests at warp speed using Docker and tmpfs”