我的 application.properties 文件中有一些配置:
...
quarkus.datasource.url=jdbc:postgresql://...:5432/....
quarkus.datasource.driver=org.postgresql.Driver
quarkus.datasource.username=user
quarkus.datasource.password=password
quarkus.hibernate-orm.database.generation=update
...
我有一个带有 @Transactional 方法的调度程序,它需要很长时间才能完成执行:
@ApplicationScoped
class MyScheduler {
...
@Transactional
@Scheduled(every = "7200s")
open fun process() {
... my slow proccess goes here...
entityManager.persist(myObject)
}
}
然后,事务方法收到一个超时错误,如下所示:
2019-06-24 20:11:59,874 WARN [com.arj.ats.arjuna] (Transaction Reaper) ARJUNA012117: TransactionReaper::check timeout for TX 0:ffff0a000020:d58d:5cdad26e:81 in state RUN
2019-06-24 20:12:47,198 WARN [com.arj.ats.arjuna] (DefaultQuartzScheduler_Worker-3) ARJUNA012077: Abort called on already aborted atomic action 0:ffff0a000020:d58d:5cdad26e:81
Caused by: javax.transaction.RollbackException: ARJUNA016102: The transaction is not active! Uid is 0:ffff0a000020:d58d:5cdad26e:81
我相信我必须增加我的事务方法的超时时间。但我不知道我该怎么做。
有人可以帮助我吗?
谢谢!