Sometimes we need to use transactions (@Transactional) in code. We use @Transactional annotation on class and method to generate transactions.
In order to troubleshoot transaction issues, it could be helpful to verify if we have an active transaction in the current method or not.
You can call this method and print output in logs. It will be true for active transactions false otherwise.
For example :
logger.error("Transaction is active " + TransactionSynchronizationManager.isActualTransactionActive());