AWS RDS中的休眠反應性非Vert.x上下文處于活動狀態 [英] Hibernate reactive No Vert.x context active in aws rds
問題描述
java.lang.IlLegalStateException:HR000065:沒有活動的Vert.x上下文
2021-11-09T17:12:18.143+02:00 Org.hibernate.reactive.context.impl.VertxContext.put(VertxContext.java:41) ~[hibernate-reactive-core-1.0.1.Final.jar!/:1.0.1.Final]
2021-11-09T17:12:18.143+02:00已抑制: Reactor.core.publisher.FluxOnAssembly$OnAssemblyException:
2021-11-09T17:12:18.143+02:00在以下位置觀察到錯誤 站點: 2021-11-09T17:12:18.143+02:00|_Checkpoint?處理程序 Com.nflp.processingapplication.main.modules.authentication.controller.PrincipalController#getUserAuthentication() [Dispatcher Handler]2021-11-09T17:12:18.143+02:00|_Checkpoint? Com.nflp.processingapplication.main.modules.api.shared.filter.ApiExceptionFilter
它并不總是發生,但在幾次之后,我開始接收對數據庫的任何請求的超時異常,看起來連接從未被釋放。 此外,我只在prod環境中收到此錯誤我們使用的是AWS rds,它在本地運行得很好,即使我創建了一條到rds實例的ssh隧道并在本地連接到prod db。 我只在我的應用程序中使用了諸如with Transaction和with Session這樣的方法,所以我認為這不會成為實現功能的問題。
API
問題與我使用Stage.Session
推薦答案實現并使用Mono.FromCompleationStage()將其轉換為反應性Java流[Flux,Mono]有關。
切換到Mutiny API后,我無法再重現此問題。
這篇關于AWS RDS中的休眠反應性非Vert.x上下文處于活動狀態的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持IT屋!