Hi I have the following code and I get the below exception. The cache runs
on 3 remote nodes and it is accessed by thick client (client = true)

String sql = "select car_id from car_code where provider_id = ? and
car_code = ? order by car_id asc limit 1;"
Integer providerId = 1;
String cardCode = "HONDA";

JssonArray array = query(sql, 3000, providerId, carCode);

JsonArray query(final String sql, final long timeoutMs, final Object...
args) {
        SqlFieldsQuery query = new SqlFieldsQuery(sql).setArgs(args);
        query.setTimeout((int) timeoutMs, TimeUnit.MILLISECONDS);

        try (QueryCursor<List<?>> cursor = cache.query(query)) {
            List<JsonArray> rows = new ArrayList<>();
            Iterator<List<?>> iterator = cursor.iterator();

            while(iterator.hasNext()) {
                List currentRow = iterator.next();
                JsonArray row = new JsonArray();

                currentRow.forEach(o -> row.add(o));

                rows.add(row);
            }

            return rows;
        } catch(Exception ex) {
        ex.printStackTrace();
        }
    }

Running this in Datagrip with JDBC client works fine;

select
    car_id
from car_code
where provider_id = 5 and car_code = 'HONDA'
order by car_id asc limit 1;

Works


javax.cache.CacheException: Failed to execute map query on remote node
[nodeId=xxxxxx, errMsg=General error: \"class
org.apache.ignite.IgniteCheckedException: Runtime failure on lookup row:
IndexSearchRowImpl
[rowHnd=org.apache.ignite.internal.processors.query.h2.index.QueryIndexRowHandler@16bc23dd]\";
SQL statement:
\nSELECT
\n__Z0.CAR_ID __C0_0
\nFROM PUBLIC.CAR_CODE __Z0
\nWHERE (__Z0.PROVIDER_ID = ?1) AND (__Z0.CAR_CODE = ?2)
\nORDER BY 1 LIMIT 1 [50000-197]]
\n\tat
org.apache.ignite.internal.processors.query.h2.twostep.GridReduceQueryExecutor.fail(GridReduceQueryExecutor.java:235)
\n\tat
org.apache.ignite.internal.processors.query.h2.twostep.GridReduceQueryExecutor.onFail(GridReduceQueryExecutor.java:214)
\n\tat
org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.onMessage(IgniteH2Indexing.java:2193)
\n\tat
org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.lambda$start$22(IgniteH2Indexing.java:2132)
\n\tat
org.apache.ignite.internal.managers.communication.GridIoManager$ArrayListener.onMessage(GridIoManager.java:3480)
\n\tat
org.apache.ignite.internal.managers.communication.GridIoManager.invokeListener(GridIoManager.java:1907)
\n\tat
org.apache.ignite.internal.managers.communication.GridIoManager.processRegularMessage0(GridIoManager.java:1528)
\n\tat
org.apache.ignite.internal.managers.communication.GridIoManager.access$5300(GridIoManager.java:242)
\n\tat
org.apache.ignite.internal.managers.communication.GridIoManager$9.execute(GridIoManager.java:1421)
\n\tat
org.apache.ignite.internal.managers.communication.TraceRunnable.run(TraceRunnable.java:55)
\n\tat
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
\n\tat
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
\n\tat java.lang.Thread.run(Thread.java:748)
\n

Reply via email to