Vlad Mihalcea High-performance Java Persistence Pdf -
If two users try to buy the last item simultaneously, the second user gets OptimisticLockException —fail fast, retry safely.
database queries. Mark all relationships ( @ManyToOne , @OneToMany , @OneToOne ) as FetchType.LAZY . If you need child collections, fetch them explicitly in your repository queries using JPQL, Criteria API, or Entity Graphs. Enable JDBC Batching vlad mihalcea high-performance java persistence pdf
