Skip to content

Commit cdd907d

Browse files
committed
Upgrade to new YDB Java SDK
1 parent 2e2582d commit cdd907d

File tree

5 files changed

+16
-9
lines changed

5 files changed

+16
-9
lines changed

.github/workflows/build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
java: [ '8', '11', '17']
2020

2121
env:
22-
MAVEN_ARGS: --batch-mode --update-snapshots -Dstyle.color=always
22+
MAVEN_ARGS: --batch-mode --update-snapshots -Dstyle.color=always -DYDB_DOCKER_ISOLATION=true
2323

2424
steps:
2525
- name: Checkout

jdbc/src/main/java/tech/ydb/jdbc/context/YdbContext.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ public static YdbContext createContext(YdbConfig config) throws SQLException {
202202
builder.withSchedulerFactory(() -> {
203203
final String namePrefix = "ydb-jdbc-scheduler[" + config.hashCode() + "]-thread-";
204204
final AtomicInteger threadNumber = new AtomicInteger(1);
205-
return Executors.newScheduledThreadPool(1, (Runnable r) -> {
205+
return Executors.newScheduledThreadPool(2, (Runnable r) -> {
206206
Thread t = new Thread(r, namePrefix + threadNumber.getAndIncrement());
207207
t.setDaemon(true);
208208
return t;
@@ -221,7 +221,13 @@ public static YdbContext createContext(YdbConfig config) throws SQLException {
221221
return new YdbContext(config, operationProps, queryProps, grpcTransport,
222222
tableClient.build(), queryClient.build(), autoResize);
223223
} catch (RuntimeException ex) {
224-
throw new SQLException("Cannot connect to YDB: " + ex.getMessage(), ex);
224+
StringBuilder sb = new StringBuilder("Cannot connect to YDB: ").append(ex.getMessage());
225+
Throwable cause = ex.getCause();
226+
while (cause != null) {
227+
sb.append(", ").append(cause.getMessage());
228+
cause = cause.getCause();
229+
}
230+
throw new SQLException(sb.toString(), ex);
225231
}
226232
}
227233

jdbc/src/test/java/tech/ydb/jdbc/YdbDriverStaticCredsTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ private void testConnection(ConnectionSupplier connectionSupplier, String userNa
7575
}
7676

7777
private void wrongConnection(ConnectionSupplier connectionSupplier) {
78-
ExceptionAssert.sqlException("Cannot connect to YDB: gRPC error: (INTERNAL) get token exception: "
78+
ExceptionAssert.sqlException("Cannot connect to YDB: Discovery failed, "
79+
+ "gRPC error: (INTERNAL) get token exception: "
7980
+ "Can't login, code: UNAUTHORIZED, issues: [#400020 Invalid password (S_FATAL)]",
8081
() -> testConnection(connectionSupplier, null));
8182
}

jdbc/src/test/resources/logging.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ handlers= java.util.logging.ConsoleHandler
22
.level=INFO
33
java.util.logging.ConsoleHandler.level = ALL
44
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
5-
java.util.logging.SimpleFormatter.format= [%1$tF %1$tT] %3$s [%4$s] %5$s %n
5+
java.util.logging.SimpleFormatter.format= %1$tF %1$tT [%4$s] %3$s %5$s %n
66

77
tech.ydb.jdbc.level=ALL
88
#tech.ydb.level=FINEST

pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<slf4j.version>1.7.36</slf4j.version>
2121
<junit.version>5.9.3</junit.version>
2222

23-
<ydb.sdk.version>2.2.0</ydb.sdk.version>
23+
<ydb.sdk.version>2.2.2</ydb.sdk.version>
2424
</properties>
2525

2626
<licenses>
@@ -118,7 +118,7 @@
118118
<plugin>
119119
<groupId>org.apache.maven.plugins</groupId>
120120
<artifactId>maven-compiler-plugin</artifactId>
121-
<version>3.12.1</version>
121+
<version>3.13.0</version>
122122
<configuration>
123123
<target>1.8</target>
124124
<source>1.8</source>
@@ -133,7 +133,7 @@
133133
<plugin>
134134
<groupId>org.apache.maven.plugins</groupId>
135135
<artifactId>maven-source-plugin</artifactId>
136-
<version>3.3.0</version>
136+
<version>3.3.1</version>
137137
<executions>
138138
<execution>
139139
<id>attach-sources</id>
@@ -173,7 +173,7 @@
173173
<plugin>
174174
<groupId>org.jacoco</groupId>
175175
<artifactId>jacoco-maven-plugin</artifactId>
176-
<version>0.8.11</version>
176+
<version>0.8.12</version>
177177
<executions>
178178
<execution>
179179
<id>jacoco-prepare-agent</id>

0 commit comments

Comments
 (0)