2

I want to see if my application (written using spring boot) has transaction management enabled.

How can I do this both programmatically and by code inspection (annotations, etc) ?

screab
  • 169
  • 3
  • 14

2 Answers2

4

Look for the EnableTransactionManagement annotation within your application, by hand or programmatically (use AnnotationUtils).

Or turn on trace for transactions:

logging.level.org.springframework.transaction.interceptor=TRACE

See also this post

Community
  • 1
  • 1
PaulNUK
  • 4,774
  • 2
  • 30
  • 58
2

You can also use the below snippet inside a transactional method.

TransactionSynchronizationManager.isActualTransactionActive()
VimalKumar
  • 1,611
  • 1
  • 14
  • 11
  • If you provide a link to documentation showing that, I'll upvote your answer. – ben3000 Oct 20 '17 at 02:43
  • I am not sure why you need a link.. here u go https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/transaction/support/TransactionSynchronizationManager.html – VimalKumar Oct 30 '17 at 18:38