Hi,
We have just migrated from c3p0 to HikariCP and ran into an issue[1] when using it with Amazon Redshift. Amazon recommends using the Postgres JDBC 8.4 driver[2], which has not implemented setQueryTimeout. The implementation is:
public void setQueryTimeout(int seconds) throws SQLException
{
checkClosed();
if (seconds < 0)
throw new PSQLException(GT.tr("Query timeout must be a value greater than or equals to 0."),
PSQLState.INVALID_PARAMETER_VALUE);
if (seconds > 0)
throw Driver.notImplemented(this.getClass(), "setQueryTimeout(int)");
timeout = seconds;
}
As can be seen, the only way to make this method work is to pass a value of 0. This can currently be achieved by setting `connectionTimeout` to 0, but it's not ideal.
I think it would be nice to disable `setQueryTimeout` for `isConnectionAlive` or to make it configurable separately from `connectionTimeout`. Thoughts?
Best,
Ismael
[1] org.postgresql.util.PSQLException: Method org.postgresql.jdbc4.Jdbc4Statement.setQueryTimeout(int) is not yet implemented.
at org.postgresql.Driver.notImplemented(Driver.java:753) ~[postgresql-8.4-702.jdbc4.jar:na]
at org.postgresql.jdbc2.AbstractJdbc2Statement.setQueryTimeout(AbstractJdbc2Statement.java:654) ~[postgresql-8.4-702.jdbc4.jar:na]
at com.zaxxer.hikari.pool.HikariPool.isConnectionAlive(HikariPool.java:459) [HikariCP-2.1.0.jar:na]
at com.zaxxer.hikari.pool.HikariPool.getConnection(HikariPool.java:175) [HikariCP-2.1.0.jar:na]
at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:94) [HikariCP-2.1.0.jar:na]