You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Igor (Jira)" <ji...@apache.org> on 2024/02/20 15:50:00 UTC

[jira] [Resolved] (IGNITE-21577) JDBC throws exception when multiple endpoints are used

     [ https://issues.apache.org/jira/browse/IGNITE-21577?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor resolved IGNITE-21577.
---------------------------
    Resolution: Won't Fix

The functionality is not supported.

> JDBC throws exception when multiple endpoints are used
> ------------------------------------------------------
>
>                 Key: IGNITE-21577
>                 URL: https://issues.apache.org/jira/browse/IGNITE-21577
>             Project: Ignite
>          Issue Type: Improvement
>          Components: jdbc
>    Affects Versions: 3.0.0-beta1
>            Reporter: Igor
>            Priority: Major
>              Labels: ignite-3
>
> *Steps to reproduce:*
> 1. Start cluster of 2 nodes.
> 2. Execute the code:
> {code:java}
> try (Connection connection = DriverManager.getConnection("jdbc:ignite:thin://localhost:10800,localhost:10801");
>         Statement statement = connection.createStatement()) {
>     statement.executeUpdate("CREATE TABLE Person (id INT PRIMARY KEY, name VARCHAR)");
>     statement.executeUpdate("INSERT INTO Person (id, name) VALUES (1, 'John')");
> } {code}
> *Expected:*
> The code is executed.
> *Actual:*
> The error is thrown on last insert statement.
> {code:java}
> java.sql.SQLException: java.util.concurrent.ExecutionException: org.apache.ignite.lang.IgniteException: IGN-CMN-65535 TraceId:bcc4730a-471d-4f66-b637-fb083e1f88a2 Failed to find resource with id: 1
> 	at org.apache.ignite.internal.jdbc.JdbcStatement.toSqlException(JdbcStatement.java:781)
> 	at org.apache.ignite.internal.jdbc.JdbcStatement.execute0(JdbcStatement.java:148)
> 	at org.apache.ignite.internal.jdbc.JdbcStatement.executeUpdate(JdbcStatement.java:181)
> 	at org.gridgain.ai3tests.tests.ConnectionTest.testSaveAndGetFromCache(ConnectionTest.java:47)
> 	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
> 	at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
> 	at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
> Caused by: java.util.concurrent.ExecutionException: org.apache.ignite.lang.IgniteException: IGN-CMN-65535 TraceId:bcc4730a-471d-4f66-b637-fb083e1f88a2 Failed to find resource with id: 1
> 	at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:395)
> 	at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1999)
> 	at org.apache.ignite.internal.jdbc.JdbcStatement.execute0(JdbcStatement.java:144)
> 	... 5 more
> Caused by: org.apache.ignite.lang.IgniteException: IGN-CMN-65535 TraceId:bcc4730a-471d-4f66-b637-fb083e1f88a2 Failed to find resource with id: 1
> 	at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:710)
> 	at org.apache.ignite.internal.util.ExceptionUtils$1.copy(ExceptionUtils.java:765)
> 	at org.apache.ignite.internal.util.ExceptionUtils$ExceptionFactory.createCopy(ExceptionUtils.java:699)
> 	at org.apache.ignite.internal.util.ExceptionUtils.copyExceptionWithCause(ExceptionUtils.java:525)
> 	at org.apache.ignite.internal.client.TcpClientChannel.readError(TcpClientChannel.java:508)
> 	at org.apache.ignite.internal.client.TcpClientChannel.processNextMessage(TcpClientChannel.java:397)
> 	at org.apache.ignite.internal.client.TcpClientChannel.lambda$onMessage$3(TcpClientChannel.java:238)
> 	at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1426)
> 	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
> 	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
> 	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
> 	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
> 	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177) {code}
> *Comments:*
> The multiple hosts for JDBC is supported according to documentation:
> [https://ignite.apache.org/docs/3.0.0-beta/sql/jdbc-driver]
> Also the code works fine if Java API is used.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)