If i using local thread(new Thread) call @TemplateQuery serviceMethod do some query, then the exception occurs.
exception info:
org.springframework.orm.jpa.JpaSystemException: Unable to acquire JDBC Connection; nested exception is org.hibernate.exception.GenericJDBCException: Unable to acquire JDBC Connection
But i found, when add @Transactional(readOnly = true) on the serviceMethod, it works!
Thanks for @wolfJ, he create a patch for com.slyak.spring.jpa.FreemarkerTemplateQuery
which return original proxy Query instead of raw and solve the problem.
If i using local thread(new Thread) call @TemplateQuery serviceMethod do some query, then the exception occurs. exception info: org.springframework.orm.jpa.JpaSystemException: Unable to acquire JDBC Connection; nested exception is org.hibernate.exception.GenericJDBCException: Unable to acquire JDBC Connection
But i found, when add @Transactional(readOnly = true) on the serviceMethod, it works!