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 ?
@Transactional Timeouts One way we can implement a request timeout on database calls is to take advantage of Spring's @Transactional annotation. It has a timeout property that we can set. The default value for this property is -1, which is equivalent to not having any timeout at all.
The default timeout for all transactions managed by the transaction manager is 60 seconds.
The @Transactional annotation is the metadata that specifies the semantics of the transactions on a method. We have two ways to rollback a transaction: declarative and programmatic. In the declarative approach, we annotate the methods with the @Transactional annotation.
The default @Transactional settings are: The propagation setting is PROPAGATION_REQUIRED. The isolation level is ISOLATION_DEFAULT. The transaction is read/write.
It seems that newer versions supports it with
spring.transaction.default-timeout= # Default transaction timeout in seconds.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With