From: Sylvain Mougenot <smougenot@sqli.com>
To: pgsql-sql@postgresql.org
Subject: JDBC Statement.setQueryTimeout : is there plan to implement this?
Date: Wed, 14 Dec 2011 14:29:39 +0100
Message-ID: <CACKdPFjK_UsZ5wExD-RvBbvi6Zo-VYtoxQsCUpWXzTN9kywj7w@mail.gmail.com> (raw)
Query timeout is not supported in JDBC (driver version 9.1-901.jdbc4)
Statement.setQueryTimeout(int seconds) throws an exception when seconds > 0.
(in drivers prior to 8.3 there was no error but it was ignored)
Using Java + transaction management, we are missing this feature badly.
I found people trying to fallback using "SELECT statement_timeout(SEC)".
But this is useless in many cases (I mean transaction manager does it's
work independently) :
- my code do not directly decides to start a transaction
- some code may have different transaction settings
So I couldn't easily introduce the good select statement at the right
moment.
Even if the behaviour is not implemented, I guess it could be "mocked" if
the call to Statement.setQueryTimeout(int seconds) generated the select
statement "SELECT statement_timeout(SEC)".
I know this is not ideal but could solve the problem temporarily.
I could even be turned on by some driver settings.
--
Sylvain Mougenot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: smougenot@sqli.com
Subject: Re: JDBC Statement.setQueryTimeout : is there plan to implement this?
In-Reply-To: <CACKdPFjK_UsZ5wExD-RvBbvi6Zo-VYtoxQsCUpWXzTN9kywj7w@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox