<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Transactions on MDT - Personal site</title><link>https://detafti.ir/en/tags/transactions/</link><description>Recent content in Transactions on MDT - Personal site</description><generator>Hugo</generator><language>en-us</language><atom:link href="https://detafti.ir/en/tags/transactions/index.xml" rel="self" type="application/rss+xml"/><item><title>Spring @Transactional does not mean what you think</title><link>https://detafti.ir/en/notes/spring-transactional-in-production/</link><pubDate>Fri, 11 Sep 2026 17:10:00 +0330</pubDate><guid>https://detafti.ir/en/notes/spring-transactional-in-production/</guid><description>&lt;p>In review I still see &lt;code>@Transactional&lt;/code> used as a blessing: put it on a method, and the database will behave. It will not. Spring starts a transaction when a &lt;strong>proxy&lt;/strong> intercepts an incoming call. If the call never hits the proxy, you have no transaction, no rollback, and a very confusing production bug.&lt;/p>
&lt;h2 id="what-i-believed--what-i-do-now">What I believed → what I do now&lt;/h2>
&lt;p>I used to sprinkle &lt;code>@Transactional&lt;/code> on every service method “to be safe.” I now put it on the one method that is the use-case boundary, I write a test that proves rollback, and I treat same-class private calls as a smell.&lt;/p></description></item></channel></rss>