Transaction Articles
3 articles about Transaction. Explore Spring Boot implementation, design, and operations across related topics.
-
How to Fix LazyInitializationException in Spring Boot + JPA - Causes and Solutions for "could not initialize proxy - no Session"
Solve the LazyInitializationException (could not initialize proxy - no Session) that crashes the moment you access a lazily-loaded association in Spring Data JPA, working backwards from how Hibernate sessions and transaction boundaries operate. Compares the four proper approaches—JOIN FETCH, @EntityGraph, DTO projection, and @Transactional—and provides criteria for making decisions without resorting to open-in-view=true or switching to EAGER.
-
How to Safely Process Large Data with Spring Batch - Introductory Guide to Job/Step/Chunk Processing
A guide to implementing large-scale batch processing with Spring Batch, complete with sample code that even beginners can follow. Covers the basic structure of Job/Step/ItemReader/ItemWriter, memory-efficient implementation using chunk processing, transaction management, and error handling with skip and retry, all using the latest syntax compatible with Spring Boot 3.x.
-
Understanding Transaction Management with @Transactional in Spring Boot - Choosing the Right Propagation and Isolation Levels
A guide to transaction management using the @Transactional annotation in Spring Boot, from basics to practical use. Covers default behavior, how to choose among the 7 propagation levels and 4 isolation levels, and how to fix common pitfalls where rollback silently fails (checked exceptions, self-invocation), with working examples.