【发布时间】:2021-09-24 03:52:40
【问题描述】:
我想在获取数据库行的悲观写锁时指定锁超时值。我发现可以在hibernate或者jpa xml属性文件中这样指定persistence.xml:
<properties>
<property name="javax.persistence.query.timeout" value="3000"/>
</properties>
如何为 spring boot 的 application.yml 文件实现相同的功能?
以下不起作用:
spring:
datasource:
url: jdbc:mysql://localhost:3306/testing
username: test
password: test123
jpa:
show-sql: true
javax.persistence.lock.timeout: 1000 #DOESN'T WORK
【问题讨论】:
标签: spring-boot hibernate spring-data-jpa