
Spring Boot @Transactional: 5 Bugs That Are Probably in Your Production Code
Spring Boot @Transactional: 5 Bugs That Are Probably in Your Production Code You deploy a new feature. Tests pass. Code review done. Production looks normal. A week later someone calls. Money is missing. The transfer left one account and never arrived at the other. No error in the logs. No exception. The transaction just... didn't work. These aren't exotic edge cases. They're the five most common @Transactional bugs, and they all share one property: they fail silently. No warning, no stack trace, just wrong data in your database. Why these bugs are hard to find: the proxy model Before the bugs, you need one piece of context. @Transactional doesn't work on your object. It works on a proxy that wraps it. When Spring creates a @Transactional bean, it builds a CGLIB subclass that intercepts incoming method calls and wraps them in transaction management. Calls that go through the proxy get a transaction. Calls that bypass the proxy don't. Every bug below is a different way of bypassing the
Continue reading on Dev.to Webdev
Opens in a new tab




