Copilot commented on code in PR #7093:
URL: https://github.com/apache/ignite-3/pull/7093#discussion_r2576521341
##########
modules/jdbc/src/integrationTest/java/org/apache/ignite/jdbc/ItJdbcConnectionFailoverTest.java:
##########
@@ -143,13 +229,19 @@ void testTransactionCannotBeUsedAfterNodeRestart() throws
SQLException {
}
}
- private static Connection getConnection(int nodesCount) throws
SQLException {
+ private static Connection getConnection(int nodesCount, String ... params)
throws SQLException {
String addresses = IntStream.range(0, nodesCount)
.mapToObj(i -> "127.0.0.1:" + (BASE_CLIENT_PORT + i))
.collect(Collectors.joining(","));
+ return getConnection(addresses, params);
+ }
+
+ private static Connection getConnection(String addresses, String ...
params) throws SQLException {
+ String args = String.join("&", params);
+
//noinspection CallToDriverManagerGetConnection
- return DriverManager.getConnection("jdbc:ignite:thin://" + addresses);
+ return DriverManager.getConnection("jdbc:ignite:thin://" + addresses +
"?" + args);
Review Comment:
When `params` is empty, the URL will end with a trailing `?` (e.g.,
`jdbc:ignite:thin://127.0.0.1:10800?`). Consider handling the empty case:
```java
String args = String.join("&", params);
return DriverManager.getConnection("jdbc:ignite:thin://" + addresses +
(args.isEmpty() ? "" : "?" + args));
```
```suggestion
return DriverManager.getConnection("jdbc:ignite:thin://" + addresses
+ (args.isEmpty() ? "" : "?" + args));
```
##########
docs/_docs/developers-guide/clients/jdbc-driver.adoc:
##########
@@ -72,6 +72,7 @@
jdbc:ignite:thin://host[:port][,host[:port][/schema][[?parameter1=value1][;param
** `partitionAwarenessMetadataCacheSize` - Size of cache to store partition
awareness metadata of queries, in number of entries. Default value: `1024`.
** `queryTimeout` - Number of seconds the driver will wait for a `Statement`
object to execute. 0 means there is no limit. Default value: `0`.
** `connectionTimeout` - Number of milliseconds JDBC client will wait for
server to respond. 0 means there is no limit. Default value: `0`.
+** `backgroundReconnectIntervalMillis` - Specifies the wait time in
milliseconds between runs of the background reconnection procedure. This
procedure is used to restore old and establish new connections to cluster
nodes. The value `0` can be used to disable background reconnection. Default
value is `30000` (30 seconds).
Review Comment:
The property name in the documentation is
`backgroundReconnectIntervalMillis`, but the actual property name defined in
the code is `backgroundReconnectIntervalMs` (see ConnectionPropertiesImpl.java
line 74 and IgniteJdbcDriver.java line 118). This inconsistency will confuse
users. Please update the documentation to use `backgroundReconnectIntervalMs`
to match the actual implementation.
```suggestion
** `backgroundReconnectIntervalMs` - Specifies the wait time in milliseconds
between runs of the background reconnection procedure. This procedure is used
to restore old and establish new connections to cluster nodes. The value `0`
can be used to disable background reconnection. Default value is `30000` (30
seconds).
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]