SQL Server JDBC – Set sendStringParametersAsUnicode to false

Introduction In this article, I’m going to explain why you should always disable the sendStringParametersAsUnicode default JDBC Driver setting when using SQL Server.

Optimistic vs. Pessimistic Locking

Introduction In this article, I’m going to explain what is the difference between optimistic and pessimistic locking, as well as when you should employ one or the other concurrency control strategies.

JPA Default Fetch Plan

Introduction In this article, I’m going to explain what the JPA Default Fetch Plan is and how it differs from the Query Fetch Plan when using FetchType EAGER associations.

Connection Monitoring with JPA and Hibernate

Introduction In this article, I’m going to show you how you can set up connection monitoring for your JPA and Hibernate application, no matter if you are using Spring or other application frameworks.

Maven and Gradle Hibernate Enhance Plugin

Introduction In this article, I’m going to explain how the configure the Maven and Gradle Hibernate Enhance Plugin. The goal of the Hibernate Enhance plugin is to instrument the JPA entity bytecode in order to improve the effectiveness and efficiency of the associated data access operations.

Hibernate LazyToOne annotation

Introduction In this article, I’m going to explain how the Hibernate LazyToOne annotation works and why you should use NO_PROXY lazy loading with bytecode enhancement. Without the LazyToOneOption.NO_PROXY annotation, the parent-side of a @OneToOne association is always going to be fetched eagerly even if you set it to FetchType.LAZY and enabled bytecode enhancement lazy loading.

Mapping Java Records to JSON columns using Hibernate

Introduction In this article, I’m going to explain how we can map Java Records to JSON columns when using Hibernate. Because Hibernate ORM does not offer built-in support for JSON, we are going to use the Hiberate Types library, which allows you to map entity attributes to JSON column types, no matter if you are using Oracle, SQL Server, PostgreSQL, or MySQL.

The JPA and Hibernate first-level cache

Introduction In this article, I’m going to explain how the JPA and Hibernate first-level mechanism works and how it can improve the performance of your data access layer. In JPA terminology, the first-level cache is called Persistence Context, and it’s represented by the EntityManager interface. In Hibernate, the first-level cache is represented by the Session interface, which extends the JPA EntityManager one.

Hibernate Session doWork and doReturningWork methods

Introduction In this article, I’m going to explain how the Hibernate Session doWork and doReturningWork methods work, and when you should use them.

Spring Boot performance monitoring

Introduction To ensure that your Spring Boot application fulfills the SLA (Service Level Agreement) requirements, you need a performance monitoring tool. In this article, I’m going to show you how you can monitor the data access layer of a Spring Boot application using Hypersistence Optimizer.