Help Center/
GaussDB/
Best Practices/
Best Practices for JDBC/
Best Practices for JDBC (Distributed Instances)/
Streaming Query/
Typical Issues
Updated on 2025-09-04 GMT+08:00
Typical Issues
- Symptom: The following exception occurs when fetchSize is set to Integer.MIN_VALUE in Statement and PreparedStatement:
org.postgresql.util.PSQLException: Fetch size must be a value greater to or equal to 0. at org.postgresql.jdbc.PgStatement.setFetchSize(PgStatement.java:1623)
Cause: The JDBC connection parameter enableStreamingQuery is not set to true.
- Symptom: The following exception occurs when the execute, executeQuery, and executeUpdate methods of Statement and PreparedStatement are called to query, insert, and update data:
org.postgresql.util.PSQLException: Streaming query statement is still active. No statements may be issued when any streaming result sets are open and in use on a given connection. Ensure that you have called .close() on any active streaming statement sets before attempting more queries. at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:492) at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:210) at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:147)
Cause: The result set from the previous streaming query has not been completely read or has not been closed.
- Sequential access only: Streaming query utilizes the FORWARD_ONLY result set, which means that data can only be accessed row by row in the forward direction. It does not support randomly locating or rolling back to previous records. If your services involve frequent traversal or require random data access, do not use streaming query.
- Configuration and compatibility requirements: Streaming query requires special configurations (Trigger Conditions) in the JDBC driver or ORM framework. Without proper configurations, the desired outcome cannot be achieved.
Parent topic: Streaming Query
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot