title: @Transactional in Lambda Expressions
body: <p>I use @transactional for DB update operations in normal functions.But in lambda expression @transactional in not allowed. How to handle this ? below is my code.</p>
  
  <pre><code>//normal function
    @Transactional
     void saveTransaction(String uniqueId) {
         Transaction transaction = new Transaction();
         transaction.setUniqueId(uniqueId);
         transactionRepository.save(transaction);
     }
  
     **@Transactional**  //Error Message - @Transactional not applicable to this field
     Consumer&lt;String&gt; saveTransaction = (uniqueId) -&gt;
     {
         Transaction transaction = new Transaction();
         transaction.setUniqueId(uniqueId);
         transactionRepository.save(transaction);
     };
  </code></pre>