<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Michael Akinrinmade</title>
    <description>The latest articles on DEV Community by Michael Akinrinmade (@michael80824373).</description>
    <link>https://dev.to/michael80824373</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F342864%2F878549f5-2c34-4c70-8166-b1c3c5c898ac.jpeg</url>
      <title>DEV Community: Michael Akinrinmade</title>
      <link>https://dev.to/michael80824373</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/michael80824373"/>
    <language>en</language>
    <item>
      <title>Understanding the Practical Application of the @Transactional Annotation in Spring Boot</title>
      <dc:creator>Michael Akinrinmade</dc:creator>
      <pubDate>Sun, 12 May 2024 20:47:13 +0000</pubDate>
      <link>https://dev.to/michael80824373/understanding-the-practical-application-of-the-transactional-annotation-in-spring-boot-200l</link>
      <guid>https://dev.to/michael80824373/understanding-the-practical-application-of-the-transactional-annotation-in-spring-boot-200l</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In Spring Boot, @Transactional is one of the most used annotations as it is used to manage transactions and used to define a scope of transaction. It can either be applied to the method level or class level. It provides data consistency and reliability.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding transaction management in Spring Boot using @Transactional
&lt;/h2&gt;

&lt;p&gt;• @Transactional annotation simplifies transaction management by providing a more declarative approach.&lt;br&gt;
• This annotation can be used at the method level or class level.&lt;br&gt;
• Developers can focus more on the business logic aspect and the annotation takes care of the transaction management.&lt;br&gt;
• Transactional annotation is used for managing transactions in the spring-boot application.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Do We Need Transaction Management?
&lt;/h2&gt;

&lt;p&gt;Let's grasp the concept of transactions through the provided example, considering we are having 2 tables, offer_criteria and offer when saving offer data into the database, it is crucial to save to save both information to the database.&lt;/p&gt;

&lt;h2&gt;
  
  
  Attributes of @Transaction
&lt;/h2&gt;

&lt;p&gt;• Propogation — defines our business logic’s transaction boundary. Spring boot manages to start and pause a transaction according to the propagation setting set.&lt;br&gt;
• Isolation- represents how changes applied by concurrent transactions are visible to each other. Each isolation level prevents zero or more concurrency side effects on a transaction. &lt;br&gt;
• ReadOnly- marks the transaction as read only.&lt;br&gt;
• TimeOut- sets the time limit for the transaction.&lt;br&gt;
• RollbackFor &amp;amp; NoRollbackFor — Specify exceptions that trigger a rollback or do not trigger a rollback, respectively.&lt;/p&gt;

&lt;p&gt;Hope this article has given you more understanding about @transactional annotation and the importance of using it when dealing with more than one database call in single transaction.&lt;/p&gt;

&lt;p&gt;Thanks for reading, kindly give like and follow for more articles.&lt;/p&gt;

</description>
      <category>java</category>
    </item>
  </channel>
</rss>
