How to use the Java CountDownLatch

Introduction In this article, we are going to see how to use the Java CountDownLatch to write test cases that take concurrency into consideration. The Java CountDownLatch has been available since version 1.5, and it’s part of the java.util.concurrent package that contains many other threading-related utilities.

SQL Server useBulkCopyForBatchInsert configuration property

Introduction In this article, we are going to see how the SQL Server useBulkCopyForBatchInsert configuration property works when using JDBC, JPA, or Hibernate.

JDBC Profiling with VisualVM

Introduction In this article, we are going to see how we can do JDBC profiling using the VisualVM tool to find slow-running SQL queries or discover N+1 query issues.

How to use different Java versions for main and test in Maven

Introduction In this article, we are going to see how we can use different Java versions for the main and test folders in Maven so that you can run tests on a newer version of Java.

MySQL rewriteBatchedStatements configuration property

Introduction In this article, we are going to see how MySQL rewriteBatchedStatements works when using JDBC, JPA, or Hibernate. I first researched this MySQL configuration property when I was writing the batching chapter of my High-Performance Java Persistence book, and, back then, I discovered that this setting allows batching plain Statement by rewriting the SQL string that is sent to the database. However, the MySQL 6 Connector/J documentation mentioned that: for prepared statements, server-side prepared statements can not currently take advantage of this rewrite option So, for a long time, I wrongly… Read More

Java Records – A Beginner’s Guide

Introduction In this article, I’m going to present to you the Records feature that was introduced in Java 14, and which aims to simplify the way we create a POJO (Plain Old Java Objects), DTO, or Value Object.