Updated on 2025-09-04 GMT+08:00

Usage Scenarios

Scenario Description

Returning a large number of query results to JDBC at once may lead to JVM memory overflow. To decrease JVM memory usage, consider using batch queries, where you can specify the number of data records to be returned to JDBC each time.

Trigger Conditions

Java applications connect to the database through JDBC and query data in large batches.

Impact on Services

Developers must start and stop transactions correctly prior to database operations. In batch query scenarios, data is processed in smaller batches to effectively reduce JVM memory usage. This approach can prevent the problem of Java application memory overflow caused by clients receiving all data at once in the traditional full data transmission mode. However, it is worth noting that traversing the result set increases the number of network interactions between the database and the client (especially when each record needs to be transmitted independently). This can lead to additional performance loss, necessitating a thoughtful balance during system design.