High-Performance Java Persistence – Chapter 14 – Batching

Are you struggling with performance issues in your Spring, Jakarta EE, or Java EE application?

Imagine having a tool that could automatically detect performance issues in your JPA and Hibernate data access layer long before pushing a problematic change into production!

With the widespread adoption of AI agents generating code in a heartbeat, having such a tool that can watch your back and prevent performance issues during development, long before they affect production systems, can save your company a lot of money and make you a hero!

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 allowing performance issues to annoy your customers, you are better off preventing those issues using Hypersistence Optimizer and enjoying spending your time on the things that you love!

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.