Nonstop Database, HiRDB Version 9 UAP Development Guide

[Contents][Index][Back][Next]

18.17.1 Estimating the Connection object size

The following shows the formulas for estimating the Connection object size.

Formula (for 32-bit mode)

Connection object size =
70000 + (11000 + send buffer size + receive buffer size) x number of Connection instances
(bytes)
 

Formula (for 64-bit mode)

Connection object size =
304000 + (14000 + send buffer size + receive buffer size) x number of Connection instances
(bytes)
 
Send buffer size: Use the formula shown below to determine the value. If multiple SQL statements are executed, you must obtain the send buffer size for each SQL statement and then use the largest value.

MAX(32768,
[Figure](240 + length of SQL statement + length of user-added information) [Figure] 4096[Figure] x 4096,
[Figure](240 + length of input parameter information + length of output parameter information
+ length of user-added information) [Figure] 4096[Figure] x 4096)
 
Length of SQL statement: Length of SQL statement (String) that has been converted to the HiRDB server's character codes
Length of user-added information: Sum of the lengths of user-added information 1, user-added information 2, and user-added information 3. Add this value if you use Connection.setHiRDB_Audit_Info.
User-added information 1: Use the following formula to determine the value:
16 + length of user-added information 1 (String) converted to HiRDB server's character codes
User-added information 2: Use the following formula to determine the value:
16 + length of user-added information 2 (String) converted to HiRDB server's character codes
User-added information 3: Use the following formula to determine the value:
16 + length of user-added information 3 (String) converted to HiRDB server's character codes
Length of input parameter information: If there are input parameters, obtain this value from the following formula and then add the resulting value:

[Figure]

Number of input parameters: See the following table:
Object Number of input parameters
PreparedStatement Number of ? parameters
CallableStatement Number of IN and INOUT parameters
Input data length: Real data length set by a setXXXX method
If the length was set by the setString method, this is the length of input data that has been converted to the HiRDB server's character codes.
Length of output parameter information: If the values of OUT and INOUT parameters are to be acquired by executing retrieval SQL statements or stored procedures, add the value obtained from the following formula:
24 + 16 x number of output parameters
Number of output parameters: If you execute retrieval SQL statements, this is the number of columns to be retrieved. If you execute stored procedures, this is the total number of OUT and INOUT parameters.
Receive buffer size: Use the formula shown below to determine the value. If you execute multiple SQL statements, obtain a receive buffer size for each SQL statement and then use the largest value.

MAX(32768,
[Figure](240 + 52 x (number of input parameters + number of output parameters)) [Figure] 4096[Figure] x 4096,
([Figure](240 + length of output data during data access by the locator facility) [Figure] 4096[Figure] x 4096)#
 
#: Use one of the following specifications to obtain this value when you use the locator facility to access data:
  • Specification of LOCATOR in the url argument of DriverManager.getConnection or in the LONGVARBINARY_ACCESS user property
  • Specification of LOCATOR in the setLONGVARBINARY_Access method of a DataSource interface
Number of input parameters: See the following table:
Object Number of input parameters
Statement 0
PreparedStatement Number of ? parameters
CallableStatement Number of IN and INOUT parameters
Number of output parameters: The value is the same as for the send buffer size.
Length of output data during data access by the locator facility: Use either of the following, as appropriate:
  • When a non-zero value is specified in HiRDB_for_Java_LONGVARBINARY_ACCESS_SIZE:
    Use the following formula to determine the value:
    HiRDB_for_Java_LONGVARBINARY_ACCESS_SIZE value x 1024
  • When 0 is specified in HiRDB_for_Java_LONGVARBINARY_ACCESS_SIZE or HiRDB_for_Java_LONGVARBINARY_ACCESS_SIZE is omitted:
    Real length of data stored in BLOB-type or BINARY-type columns