Jakarta.persistence.query.timeout not working on Hibernate 6.4.4 for long queries

Hi all,

I am exploring jakarta.persistence.query.timeout to get long-running queries to throw an exception, to avoid application thread starvation. However, it doesn’t seem to work.

I’ve filed a bug report here: Hibernate ORM - Issues - Hibernate JIRA

Has anybody tried and got query timeout working on Hibernate 6.4.4 or higher?

Would greatly appreciate if you could share any working steps or advice.

Thanks,
Victor

I commented on the Jira issue. There is no Hibernate ORM bug. The behavior is fully dependent on the JDBC driver.

1 Like

Yes, my question was answered.

Basically, a timeout exception would be thrown if the JDBC query took longer than the n secs configured in “jakarta.persistence.query.timeout”.

However, no timeout exception would be thrown if: