Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-21577

JDBC throws exception when multiple endpoints are used

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Reopened
    • Major
    • Resolution: Won't Fix
    • 3.0.0-beta1
    • None
    • jdbc

    Description

      Steps to reproduce:
      1. Start cluster of 2 nodes.

      2. Execute the code:

      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')");
      } 

      Expected:
      The code is executed.

      Actual:
      The error is thrown on last insert statement.

      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) 

      Comments:

      The multiple hosts for JDBC is not supported according to documentation, but it will be good to do it:[ https://ignite.apache.org/docs/3.0.0-beta/sql/jdbc-driver|https://ignite.apache.org/docs/3.0.0-beta/sql/jdbc-driver]

      Also the code works fine if Java API is used.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              lunigorn Igor
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: