"SQLException: ResultSet(..) is not active" occurs

{question}

We're seeing an issue where a few queries fail with following exception:

Caused by: java.sql.SQLException: ResultSet(####) is not active. 
at com.nuodb.jdbc.SQLStateException.createDefault(SQLStateException.java:###) 
at com.nuodb.jdbc.SQLStateException$10.create(SQLStateException.java:###) 
at com.nuodb.jdbc.SQLStateException.raise(SQLStateException.java:###) 
at com.nuodb.jdbc.RemConnection.sendAndReceive(RemConnection.java:###) 
at com.nuodb.jdbc.RemConnection.sendAndReceive(RemConnection.java:###5) 
at com.nuodb.jdbc.RemResultSet.next(RemResultSet.java:###) 
at org.hibernate.internal.ScrollableResultsImpl.next(ScrollableResultsImpl.java:###)

What does it mean?

{question}

{answer}

You should see this message when the result set is being used but the statement was closed already.

ie.:

ResultSet rs = stmt.executeQuery(…);

stmt.close();

while (rs.next()) {}

I'm guessing that's not exactly what you're doing or how you do it and so I'll try to add more context.

The way NuoDB works is as follows: We send the result set from the server to the client in chunks (i.e if you do a select from a table with a million columns we will send only (e.g.) 1000 rows, then the user calls next() and we send another 1000), so the code above fails when the result set doesn’t fit in a single chunk from the server and the client asks for more chunks. 

{answer}

Have more questions? Submit a request

Comments