Service Execution Exceptions

Broken pipe, connection reset by peer

Possible cases: The network is faulty and the database connection times out.

Solution: Check the network status, rectify the network fault, and rectify the configuration related to database connection timeout, for example, the database parameter session_timeout.

  1. Log in to the DWS console and click the name of the target cluster.
  2. On the displayed page, click the Parameters tab and search for session_timeout to view the timeout interval.
  3. Set the CN value and DN value to 0. For details, see Modifying Database Parameters.

The column index is out of range

Possible cause: The result set obtained by the application is not the expected one, and the number of columns is incorrect.

Solution: Check the database table definition and SQL statements. If the result set contains only three columns, the maximum value of index is 3.

Error Caused by SQL Containing Too Many Parameters. Tried to send an out-of-range integer as a 2-byte value

Problem analysis: According to the JDBC protocol, the total number of variables cannot exceed 32767, which is the maximum value of short Int.

Solution:

Data query: Split large SQL statements to ensure that the number of variables in each SQL statement is less than 32767.

Data import: Import data in batches or use copymanager . For details, see CopyManager.

Error "ERROR: cached plan must not change result type" Reported When the Stored Procedure Is Invoked

Problem analysis: PreparedStatement is used in JDBC. By default, a plan is cached after being executed for five times. If there are table-creation operations after that (for example, the table definition modification), the error ERROR: cached plan must not change result type will be reported when the plan is executed again.

Handling method: Set prepareThreshold to 0 in the JDBC connection string so that the plan is not cached. Example:

1
String url = "jdbc:postgresql:// 192.168.0.10:2000/postgres?prepareThreshold=0";