6
votes

I am using the spring-boot-starter-data-jpa from Spring Boot 1.4.2.

Everything works fine (@Entity classes discovery, datasource autoconfiguration, transaction autoconfiguration, EntityManager autoconfiguration).

I can not find where the Transaction timeout can bet set. Since I want to use Spring Boot as deep as possible, I do not wish to declare programmatically a transaction manager bean in any Config file.

The "common application properties reference" only mention timeouts for JTA Transaction managers, but none for the autoconfigure one for simple JPA use. Note that I am not looking for the jdbc query timeout.

Any ideas ?

1
If youre using the @Transactional annotation in the class using the EntityManager , you can just use e.g.: @Transactional(timeout = 10) - sas

1 Answers

11
votes

It seems that newer versions supports it with

spring.transaction.default-timeout= # Default transaction timeout in seconds.