Smit Pataliya’s Post

Most developers misuse @Transactional and don’t even realize it 👇 At first, I thought adding @Transactional everywhere would make my code “safe”. It doesn’t. Here’s what actually happens: ❌ Transaction won’t work on private methods ❌ Internal method calls skip Spring proxy ❌ Rollback doesn’t trigger for checked exceptions by default Example mistake: Calling a transactional method inside the same class → No transaction applied Why? 👉 Spring uses proxies, not direct method execution What I do now: ✅ Keep transactions in service layer ✅ Avoid internal method calls ✅ Understand rollback behavior Small annotation. Big production bugs if misunderstood. Save this before your next backend issue. What’s a mistake you learned the hard way? 👇 #SpringBoot #Java #BackendDevelopment #CleanCode #SoftwareEngineering

  • graphical user interface, diagram, application

To view or add a comment, sign in

Explore content categories