如何指示 QuarkusApplication 等待反应式 vertx MySQLPool 完成executeBatchAndForget 语句的执行?
我们需要将大型文件加载到MySQL DB。我已经写了一个简单的quarkusapplication
quarkus-ractive-mysql-client
以执行executeBatchandForget
以将记录导入到数据库中。我看到以下错误,这表明主应用程序已经停止,因此池已关闭。
错误[io.qua.mut.run.mutinyinfrastructure](vert.x-eventloop-thread-0)utiny必须删除以下例外:io.vertx.core.impl.impl.nostacktractractractracthrowable:pool loce offer
pool pool
我可以使用executeBatchandawait
哪种消除了应用程序的反应性,因此避免了它。
有没有办法阻止主应用程序关闭,直到MySQLPool完成处理?
更新
我尝试了一个工作。例如,说明我有n
批次(记录数/批量大小),如果我为n记录运行executeBatchandForget()
,然后运行executebatchandawait()< /代码>对于
语句似乎也有效。剩余
,该应用程序似乎正在等待完成所有插入。如果没有余数,的
executeandawait()
select
We have a requirement to load a huge file to MySQL DB. I have written a simple QuarkusApplication
with quarkus-reactive-mysql-client
to execute a executeBatchAndForget
to batch import the records into the DB. I see the below error, which suggests that the Main application has stopped, and hence the pool is closed.
ERROR [io.qua.mut.run.MutinyInfrastructure] (vert.x-eventloop-thread-0) Mutiny had to drop the following exception: io.vertx.core.impl.NoStackTraceThrowable: Pool closed
I could use executeBatchAndAwait
which kind of eliminates the reactive nature of the application, hence avoiding it.
Is there a way to stop the Main application from closing until the MySqlpool finishes the processing?
Update
I have tried a work-around. Say for example if I have n
batches (number of records / batch size) and if I run executeBatchAndForget()
for n records and then run executeBatchAndAwait()
for the remainder
, the application seems to be waiting to complete all inserts. In case of no remainder, an executeAndAwait()
of SELECT
statement also seems to work.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论