Monthly Archives: August 2020

Best-Practice for Transaction with Spring

  • no self-invocation of transaction in paticular
  • no self-invocation of public methods in general
  • rollback only for RuntimeExceptions and Errors
  • do not use a “self” proxy reference
  • further literature:
    • https://docs.spring.io/spring/docs/4.2.x/spring-framework-reference/html/transaction.html#transaction-declarative-rolling-back
    • https://blog.frankel.ch/a-spring-hard-fact-about-transaction-management/
    • https://stackoverflow.com/a/23934667
    • https://codete.com/blog/5-common-spring-transactional-pitfalls/