All posts
-
How to Fix "failed to lazily initialize a collection" in Spring Data JPA and Hibernate
Hibernate's LazyInitializationException ("failed to lazily initialize a collection") is a classic pitfall when reading foreign-key collections outside an active session. This article explains why it happens — fetch types, the session lifecycle, proxy traps — and walks through the recommended `@Transactional` fix plus the `FetchType.EAGER` alternative.
-
Java 17 Sealed Classes: sealed, non-sealed, final, and permits Explained
Java 17 promoted sealed classes and interfaces to a standard feature after debuting as a preview in Java 15. This post walks through how sealed, non-sealed, permits, and final fit together to give you precise control over who can extend a class or implement an interface — plus a step-by-step animal hierarchy example (Animal → Chordata → Bird → Parrot / Penguin) that demonstrates every state in action.
-
Java 16 record Tutorial: How record, Lombok, and POJO Compare
Java 16 added a new kind of class called record, designed specifically for holding data. This post walks through record, compares it side-by-side with traditional POJOs and Lombok's code-generation annotations, and shows where each approach still has a place — including why record can't fully replace Lombok's Builder or mutable POJOs.
-
Linux top Command: Sort, Search, and Filter Processes Interactively
The Linux top command shows a live view of running processes. This guide covers the interactive-mode shortcuts you need most: filtering by user, filtering by command, sorting by memory or CPU, and navigating the list.