Skip to content

Commit

Permalink
Merge pull request #203 from tigergraph/jdbc-dev-sync
Browse files Browse the repository at this point in the history
[Automated]JDBC Driver Release 1.3.8
  • Loading branch information
chengjie-qin committed Jun 2, 2023
2 parents 472e992 + 7de2e5a commit 88e4c09
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
5 changes: 5 additions & 0 deletions tools/etl/tg-jdbc-driver/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## Release 1.3.8
* Supported TG Version: 2.4.1+
* Bugfixes:
1. Increase the default connectTimeout to 30s and socketTimeout to 60s

## Release 1.3.7
* Supported TG Version: 2.4.1+
* New Features:
Expand Down
2 changes: 1 addition & 1 deletion tools/etl/tg-jdbc-driver/tg-jdbc-driver/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.tigergraph</groupId>
<artifactId>tigergraph-jdbc-driver</artifactId>
<version>1.3.7</version>
<version>1.3.8</version>
<packaging>jar</packaging>

<name>TigerGraph JDBC Driver Parent</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public class TableResults {
* stored in a map. So the list of map represents a table.
*/
private List<Map<String, Object>> results;

// List of column attributes.
private List<Attribute> attributeList;
private String table_name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ public class RestppConnection extends Connection {
private String src_vertex_type = null;
private Integer atomic = 0;
private Integer timeout = -1; // the timeout setting for gsql query
private Integer connectTimeoutMS =
5 * 1000; // the timeout setting for establishing an http connection(5s)
private Integer connectTimeoutMS = 30 * 1000;
private Integer socketTimeoutMS = 60 * 1000;
private Integer level = 1;
private String[] ipArray = null;
private ComparableVersion tg_version = new ComparableVersion(DEFAULT_TG_VERSION);
Expand Down Expand Up @@ -142,6 +142,14 @@ public RestppConnection(
this.timeout = Integer.valueOf(properties.getProperty("timeout"));
}

if (System.getProperty("jdbc.connectTimeout") != null) {
this.connectTimeoutMS = Integer.valueOf(System.getProperty("jdbc.connectTimeout"));
}

if (System.getProperty("jdbc.socketTimeout") != null) {
this.socketTimeoutMS = Integer.valueOf(System.getProperty("jdbc.socketTimeout"));
}

// Get token for authentication.
if (properties.containsKey("token")) {
this.token = properties.getProperty("token");
Expand Down Expand Up @@ -383,7 +391,10 @@ public RestppConnection(
}
// Set the timeout for establishing a connection
builder.setDefaultRequestConfig(
RequestConfig.custom().setConnectTimeout(connectTimeoutMS).build());
RequestConfig.custom()
.setConnectTimeout(connectTimeoutMS)
.setSocketTimeout(socketTimeoutMS)
.build());
builder.setRetryHandler(new DefaultHttpRequestRetryHandler());
this.httpClient = builder.build();

Expand Down

0 comments on commit 88e4c09

Please sign in to comment.