How to use transaction manager based on a condition while using @Transactional
I am working on a spring boot project and have a requirement where I need to choose from a set of transaction managers based on a condition(which involves @RequestParam annotated variable) and use the selected transaction manager in the ‘value’ attribute of @Transactional annotation on a method ?
Is the getReferenceById repository method really lazy loading and how to test it throws an exception?
I understand the getReferenceById
repository method is lazy loading the entity.