I'm getting Unable to acquire JDBC Connection exception
After trying several approaches for a while I found two ways to get this working.
Create a new
EntityManager
viaEntityManagerFactory
and useEntityManager.close()
method.Just annotate the repository method with
@Transactional
annotation as suggested in @Procedure annotation orphaning database connections (spring-data-jpa). I know a repository is not the best place to put a@Transactional
annotation but it worked like charm.
Maybe you might want to mark this post as a duplicate, but anyway, my first solution seems to be working too.
Thanks!