title: Spring Transaction: What will happen if I don't give @Transaction annotation on method
body: <p>I am using Spring-Boot, Spring Rest Controller and Spring Data JPA. If I don't specify @Transaction then also record get's created but I will like to understand how it happens.My understanding is that Spring by default adds a transaction with default parameters but not sure where it adds is it add Service layer or at Repository.</p>
  
  <pre><code> public interface CustomerRepository extends CrudRepository&lt;Customer, Long&gt; {
  
      List&lt;Customer&gt; findByLastName(String lastName);
   }
  
   @Service
   public class CustomerServiceImpl implements CustomerService&gt; {
  
     List&lt;Customer&gt; findByLastName(String lastName){
       //read operation
      }
  
   // What will happen if @Transaction is missing. How record get's created without the annotation
    public Customer insert(Customer customer){
    // insert operations
     }
   }
  </code></pre>