How can I implement query timeout with Hibernate and PostgreSQL? Unfortunately, query.setTimeout(int) doesn't work, because the PostgreSQL JDBC driver ignores it.
JIRA has a brief mention of new support for Postgres.
http://opensource.atlassian.com/projects/hibernate/browse/HHH-4765How do I access it? PostgreSQL SQL has no "SELECT ... FOR UPDATE WAIT 1000" construct as is mentioned in the JIRA for Oracle. The official PostgreSQL method of query timeout is with the SQL statement:
SET LOCAL statement_timeout TO 1000;
But I can't find a way to execute a SQL "SET" statement with a Hibernate EntityManager native query.
This is a pretty basic issue -- does anybody have a clue?
Thanks,
--Steve