Overview
Version
Report Server Version | Functional Change |
10.0.18 |
|
11.0.2 | Optimized the advanced setting layout. |
11.0.23 | Adjusted the Fetchsize parameter automatically for all databases. |
Function Description
This document introduces how to configure advanced settings and what each parameter in the advanced setting attribute means.
Connection pool
Fetchsize
Specific Introduction
Advanced Setting
When connecting to FineReport, you can configure some advanced settings on the connection page on the platform or in the designer, as shown in the following figure.
Advanced settings in the designer
Advanced settings on the platform
Introduction to Connection Pool Attribute Parameters
Commonly used connection pool attributes
Name | Druid Scientific Name | Default Value | Definition |
Max Active Connection | maxActive | 50 | Represents the maximum number of active connections that the connection pool can allocate at the same time. |
SQL Verification Query | validationQuery | Default statement | Represents the SQL statement (a query statement, often in select x format) used to check whether a connection is valid. You can customize the statement. |
Test Before Connection | testOnBorrow | Yes | Executes validationQuery to check whether the connection is valid during connection applying. |
Max Wait Time | maxWait | 10000 | Represents the maximum waiting time (unit: millisecond) to obtain a connection. |
Uncommonly used connection pool attributes (which you are not advised to modify without special circumstances)
Name | Druid Scientific Name | Default Value | Definition |
Number of Initial Connections | initialSize | 0 | Represents the number of physical connections established during initialization. |
Min Number of Idle Connections | minIdle | 0 | Represents the minimum number of connections. |
Detection Before Returning Connections | testOnReturn | No | Executes validationQuery to check whether the connection is valid during connection returning. |
Detection by Idle Connection Recycler | testWhileIdle | No | Indicates whether the connection is checked by the idle connection recycler (if any), and if the check fails, the connection will be removed from the pool. |
Sleep Time of Idle Connection Recycler | timeBetweenEvictionRunsMillis | -1 | Represents the sleep time value (unit: millisecond) of the idle connection recycler during the thread runtime. |
Number of Idle Connections Detected by Recycler | numTestPerEvictionRun | 3 | Represents the number of connections checked by the idle connection recycler (if any) during the thread runtime each time. |
Min Idle Time | minEvictableIdleTimeMillis | 1800s | Represents the minimum time to keep the connection idle without being evicted. |
If the set value of Max Active Connection exceeds the number of connections in the database, the number of connections in the database shall prevail. If you want to adjust the number of active connections to the maximum, you also need to adjust the number of connections in the database. For solutions, see Connection Pool Full.
Fetchsize setting
The Fetchsize parameter is used to control the number of records to be processed in batches for obtaining data from the database. A smaller value of the Fetchsize parameter can reduce the memory consumption of each database query, but may require more database round trips to retrieve the complete result set; a larger value of the Fetchsize parameter can reduce the number of database round trips, but will increase memory usage. You can optimize the database query performance by setting Fetchsize as required.
If the parameter value ≤ 0 (for example: -20), the Fetchsize parameter is disabled.
1. The Fetchsize parameter must be set for the Oracle, DB2, and Postgre databases. If the parameter value ≤ 0, the value will be automatically replaced by 128, 50, and 10000 respectively.
2. The Fetchsize parameter is disabled for other databases by default.
You can also set Fetchsize for the Oracle, DB2, and Postgre databases in the data connection in the designer. You can enter any value from 1 to 1,000,000. If the value is empty, the parameter is not configured.
Notes
If a connection timeout or waiting status is reported when you access the template, the warning is as follows.
Warning: Cannot get a connection, pool error Timeout waiting for idle object
at com.fr.third.org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:114)
at com.fr.third.org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
at com.fr.data.pool.MemoryConnection.create(Unknown Source)
at com.fr.data.impl.JDBCDatabaseConnection.createConnection(Unknown Source)
You need to increase the corresponding number of connections.