Is there a way to set query timeout on JDBC staments?

731 views
Skip to first unread message

javadevmtl

unread,
Apr 18, 2022, 12:05:56 PM4/18/22
to vert.x
Hi using vertx 3.9.x

I have a stored procedure that blocks vertx and we get the the blocked thread checker warning.

Is there a setting we can set to kill the JDBC connection or the query before?

Looking at Hikari pool setting I don't see anything specific to query timeout.

So is it possible to call the setQueryTimout?


javadevmtl

unread,
Apr 27, 2022, 5:02:57 PM4/27/22
to vert.x
Hi any thoughts on this?

Thomas SEGISMONT

unread,
Apr 29, 2022, 3:56:19 AM4/29/22
to ve...@googlegroups.com
Hi,

The JDBC Client does not let you retrieve the PreparedStatement and execute methods.
However you may be able to use Hikari's connectionInitSql property to set a session level query timeout (if your DB supports it).

--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/3a002015-6f4b-4e4c-b657-47146da74c31n%40googlegroups.com.

colin....@canopytax.com

unread,
May 17, 2022, 11:19:28 AM5/17/22
to vert.x
I am also on 3.9.x and with io.vertx.ext.sql.SQLConnection we call connection.setOptions(new SQLOptions().setQueryTimeout(30)); to time out queries after 30 seconds. Not sure if this applies to your situation though.

javadevmtl

unread,
May 19, 2022, 11:00:51 AM5/19/22
to vert.x
Hi, thanks I'll check it out!
Reply all
Reply to author
Forward
0 new messages