equals, hashCode, and the Entity That Vanished From a HashSet
How HashMap actually finds things, the contract nobody reads, and why the obvious equals() on a JPA entity breaks the moment you save it.
Notes from building production systems: backend architecture, Spring Boot, and the occasional frontend detour.
How HashMap actually finds things, the contract nobody reads, and why the obvious equals() on a JPA entity breaks the moment you save it.
One instance, hundreds of concurrent requests, and every field you added is shared between them. Why local variables are safe, why volatile isn't a lock, and the ThreadLocal leak that serves one tenant's data to another.
The annotation is one word, so it feels like it can't go wrong. It can: self-invocation, checked exceptions, swallowed failures, and the transaction that ends before your response does.
How to see the queries your app actually runs, why the obvious join fetch fix breaks pagination, and the three tools I reach for instead.
The read-modify-write bug that lets two cashiers sell the same last item, why @Transactional doesn't save you, and how I made sales in Raaqib atomic and safe to retry.
Why a long-lived JWT is a liability, how rotating refresh tokens with reuse detection fixes it, and the two problems nobody warns you about: the multi-tab race and revoking permissions mid-session.
How I isolate tenant data in Raaqib using Hibernate @Filter instead of a schema per tenant: the setup, the four ways it silently leaks, and how I test that it doesn't.