Skip to content
Advertisement

Run code without transaction in transactional mehod spring

I have service like this:

JavaScript

How can I run method2 without transaction or in new transaction? Can I run in my controller class this 2 method like this:

JavaScript

Advertisement

Answer

@Transactional is powered by Aspect-Oriented Programming. Therefore, processing occurs when a bean is called from another bean. You can resolve this problem by

  • self-inject
JavaScript
  • create another bean.
JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement