Skip to content

Commit

Permalink
Modify JDBC driver connection behaviour to fail early if the delegate…
Browse files Browse the repository at this point in the history
… JDBC Driver cannot be instantiated. Connection attempts remain inside a retry loop.

Refs #230
  • Loading branch information
rnorth committed Jan 22, 2017
1 parent deab822 commit d8d6df8
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,10 @@ public Connection createConnection(String queryString) throws SQLException {
info.put("password", this.getPassword());
final String url = this.getJdbcUrl() + queryString;

final Driver jdbcDriverInstance = getJdbcDriverInstance();

try {
return Unreliables.retryUntilSuccess(120, TimeUnit.SECONDS, () -> getJdbcDriverInstance().connect(url, info));
return Unreliables.retryUntilSuccess(120, TimeUnit.SECONDS, () -> jdbcDriverInstance.connect(url, info));
} catch (Exception e) {
throw new SQLException("Could not create new connection", e);
}
Expand Down

0 comments on commit d8d6df8

Please sign in to comment.