Skip to content

Commit

Permalink
[CONJ-490] DataSource connectTimeout is in second, but was set on soc…
Browse files Browse the repository at this point in the history
…ket timeout that is in milliseconds
  • Loading branch information
rusher committed Jun 5, 2017
1 parent d129c09 commit c8c1c54
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions documentation/changelog.creole
Expand Up @@ -28,6 +28,7 @@ report of 2.0.2 corrections for jre 1.7 compatible version.

== 2.0.2
Bug
*[CONJ-490] - DataSource connectTimeout is in second, but was set on socket timeout that is in milliseconds
*[CONJ-481] - Buffer overrun reading ResultSet when using option "useServerPrepStmts"
*[CONJ-470] - Error when executing SQL contains "values" and rewriteBatchedStatements=true
*[CONJ-471] - PK_NAME returned by DatabaseMetadata.getPrimaryKeys() should not be null
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/mariadb/jdbc/MariaDbDataSource.java
Expand Up @@ -330,7 +330,7 @@ public void setLogWriter(final PrintWriter out) throws SQLException {
* @since 1.4
*/
public int getLoginTimeout() throws SQLException {
return urlParser.getOptions().connectTimeout == null ? 0 : urlParser.getOptions().connectTimeout;
return urlParser.getOptions().connectTimeout == null ? 0 : urlParser.getOptions().connectTimeout / 1000;
}

/**
Expand All @@ -345,7 +345,7 @@ public int getLoginTimeout() throws SQLException {
*/
@Override
public void setLoginTimeout(final int seconds) throws SQLException {
urlParser.getOptions().connectTimeout = seconds;
urlParser.getOptions().connectTimeout = seconds * 1000;
}

/**
Expand Down

0 comments on commit c8c1c54

Please sign in to comment.