High-Performance Java Persistence – Chapter 14 – Batching

Imagine having a tool that can automatically detect JPA and Hibernate performance issues. Wouldn’t that be just awesome?

Well, Hypersistence Optimizer is that tool! And it works with Spring Boot, Spring Framework, Jakarta EE, Java EE, Quarkus, or Play Framework.

So, enjoy spending your time on the things you love rather than fixing performance issues in your production system on a Saturday night!

Part 2, Chapter 14

Every new chapter of my book is released right after it’s being completed, so the reader doesn’t have to wait for the whole part to be finished to get access to new material.

Table of content

This chapter explains how batch updates work in Hibernate.

14. Batching
14.1 Batching insert statements
14.2 Batching update statements
14.3 Batching delete statements

Chapter summary

Batch updates can have a great impact on data access layer performance, and Hibernate makes it very easy to switch from non-batchable statements to batched PreparedStatement(s). In this chapter, I explain how you can enable JDBC batching for insert, update, and delete statements.

Because setting the hibernate.jdbc.batch_size configuration property is not always enough, I also explain how statement ordering can leverage JDBC batching when using entity state cascading.

Aside from writing this chapter, I managed to review all the previous chapters for typos and grammar issues, thanks to using Grammarly.

Previously, I was relying on Office for correcting grammar issues, but, although it definitely helped me, I noticed that it was not enough. For this purpose, I purchased a Grammarly subscription and went through all the previous chapters for fixing typos and other grammar-related problems.

Transactions and Concurrency Control eBook

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.