Hello! Does this happen every time? If so, which is the # of row on which it will happen?
Regards, -- Ilya Kasnacheev вт, 27 нояб. 2018 г. в 10:09, yangjiajun <1371549...@qq.com>: > Hello. > > I did a scan query on a table which has 8w records and tried to go through > all records in the result set but got following exception: > > [13:53:31,523][SEVERE][client-connector-#77][JdbcRequestHandler] Failed to > fetch SQL query result [reqId=0, req=JdbcQueryFetchRequest > [queryId=38106237, pageSize=1024]] > class org.apache.ignite.internal.processors.query.IgniteSQLException: The > object is already closed [90007-195] > at > > org.apache.ignite.internal.processors.query.h2.H2ResultSetIterator.fetchNext(H2ResultSetIterator.java:136) > at > > org.apache.ignite.internal.processors.query.h2.H2ResultSetIterator.onHasNext(H2ResultSetIterator.java:142) > at > > org.apache.ignite.internal.util.GridCloseableIteratorAdapter.hasNextX(GridCloseableIteratorAdapter.java:53) > at > > org.apache.ignite.internal.util.lang.GridIteratorAdapter.hasNext(GridIteratorAdapter.java:45) > at > > org.apache.ignite.internal.processors.query.GridQueryCacheObjectsIterator.hasNext(GridQueryCacheObjectsIterator.java:61) > at > > org.apache.ignite.internal.processors.odbc.jdbc.JdbcQueryCursor.fetchRows(JdbcQueryCursor.java:72) > at > > org.apache.ignite.internal.processors.odbc.jdbc.JdbcRequestHandler.fetchQuery(JdbcRequestHandler.java:587) > at > > org.apache.ignite.internal.processors.odbc.jdbc.JdbcRequestHandler.handle(JdbcRequestHandler.java:206) > at > > org.apache.ignite.internal.processors.odbc.ClientListenerNioListener.onMessage(ClientListenerNioListener.java:160) > at > > org.apache.ignite.internal.processors.odbc.ClientListenerNioListener.onMessage(ClientListenerNioListener.java:44) > at > > org.apache.ignite.internal.util.nio.GridNioFilterChain$TailFilter.onMessageReceived(GridNioFilterChain.java:279) > at > > org.apache.ignite.internal.util.nio.GridNioFilterAdapter.proceedMessageReceived(GridNioFilterAdapter.java:109) > at > > org.apache.ignite.internal.util.nio.GridNioAsyncNotifyFilter$3.body(GridNioAsyncNotifyFilter.java:97) > at > org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:110) > at > > org.apache.ignite.internal.util.worker.GridWorkerPool$1.run(GridWorkerPool.java:70) > at > > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) > at > > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) > at java.lang.Thread.run(Thread.java:748) > Caused by: org.h2.jdbc.JdbcSQLException: The object is already closed > [90007-195] > at > org.h2.message.DbException.getJdbcSQLException(DbException.java:345) > at org.h2.message.DbException.get(DbException.java:179) > at org.h2.message.DbException.get(DbException.java:155) > at org.h2.message.DbException.get(DbException.java:144) > at org.h2.jdbc.JdbcResultSet.checkClosed(JdbcResultSet.java:3208) > at org.h2.jdbc.JdbcResultSet.next(JdbcResultSet.java:130) > at > > org.apache.ignite.internal.processors.query.h2.H2ResultSetIterator.fetchNext(H2ResultSetIterator.java:110) > ... 17 more > > My ignite version is 2.6 and I only started one node.I did not call any > close methods. Why ignite closed my result set? > > Here is my test code: > > import java.sql.Connection; > import java.sql.DriverManager; > import java.sql.ResultSet; > import java.sql.ResultSetMetaData; > import java.sql.Statement; > import java.util.Properties; > > public class StatementTest { > > private static Connection conn; > > > public static void main(String[] args) throws Exception { > > long t1 = System.currentTimeMillis(); > try { > initialize(); > > String selectSql = "SELECT * FROM > table_6932_r_1_1"; > testQuery(selectSql); > } catch (Exception e) { > throw e; > } finally { > if (conn != null) > conn.close(); > } > long t2 = System.currentTimeMillis(); > System.out.println("operation costs " + (t2 - t1) + " ms"); > } > > public static void close() throws Exception { > conn.close(); > } > > public static void initialize() throws Exception { > Class.forName("org.apache.ignite.IgniteJdbcThinDriver"); > String dbUrl = > > "jdbc:ignite:thin://ip:port;lazy=true;skipReducerOnUpdate=true;replicatedOnly=true"; > conn = DriverManager.getConnection(dbUrl, props); > } > > public static void testUpdate(String sql) throws Exception { > try (Statement stmt = conn.createStatement()) { > stmt.setQueryTimeout(10); > stmt.executeUpdate(sql); > } > } > > public static void testQuery(String sql) throws Exception { > long startTime=System.currentTimeMillis(); > try (Statement stmt = conn.createStatement()) { > //stmt.setQueryTimeout(10); > try (ResultSet rs = stmt.executeQuery(sql)) { > > ResultSetMetaData rsmd = rs.getMetaData(); > int colCount = rsmd.getColumnCount(); > int count = 1; > try{ > while (rs.next()) { > //Thread.sleep(10); > > for (int i = 1; i <= > colCount; i++) { > > System.out.print(rsmd.getColumnName(i) + ":" + rs.getObject(i) + " > "); > } > System.out.println(count); > count++; > } > }catch(Exception e){ > > System.out.println(System.currentTimeMillis()-startTime)); > System.out.println(rs.isClosed()); > > System.out.println(stmt.isClosed()); > > System.out.println(conn.isClosed()); > } > > } > } > } > } > > > > -- > Sent from: http://apache-ignite-users.70518.x6.nabble.com/ >