参考文档:AOL/J JDBC Connection Pool White Paper (文档 ID 278868.1)
The JDBC Pool in e-Business Suite is implemented through the core java technology framework for the entire suite (named AOL/J). AOL/J uses the “dbc” file in order to obtain the parameters needed to create a database connection. AOL/J technology uses JDBC, mostly and more intensively, (AOL/J 使用dbc文件作为建立数据库连接的参数)in web applications. When starting iAS HTTPD it launches the ApacheJserv engine(R12应用是mod-OC4J). During the startup of ApacheJerv is when the pool is built, based on the parameters specified by the DBC file. The DBC file is located under $FND_TOP/secure and is generated during installation time. Here’s an example of a DBC file:
#DB Settings
#Wed Oct 29 13:08:09 EST 2003
APPS_JDBC_DRIVER_TYPE=THIN
APPL_SERVER_ID=C07944762D3D6A6EE0340003BA0DE5CC42929651847093158337209480361998
TWO_TASK=PROD
GUEST_USER_PWD=GUEST/ORACLE
DB_HOST=gjimenez-sun.us.oracle.com
DB_NAME=PROD
FNDNAM=APPS
GWYUID=APPLSYSPUB/PUB
DB_PORT=14001
This particular example does not include any sizing parameter for the JDBC connection pool and, when initialized, it will start with the default values for the following parameters:
FND_JDBC_MAX_CONNECTIONS: 2147483647 (Defined as Integer.MAX, in java.lang.Integer)
FND_JDBC_BUFFER_MIN: 5
FND_JDBC_BUFFER_MAX: 50%
The default parameters basically means that:
· A maximum of 2147483647 connections will be opened.
· When started, the JDBC Connection pool will open 5 connections as a minimum.
· In order to start reusing connections, when the percentage (or number) declared in parameter FND_JDBC_BUFFER_MAX of FND_JDBC_MAX_CONNECTIONS is reached.
When using the default settings in a heavily used system, it is possible to encounter situations where the size of the pool grows, leaving the database running out of processes or out of connections. If this condition surfaces, the best way to deal with this situation is to reconfigure the AOL/J database connection pool parameters. Please, before doing this, check with Oracle Support Services if effectivelly changing these parameters will fix your situation.
NOTE |
We are changing the default values for the parameter FND_JDBC_MAX_CONNECTIONS in Bug#3186367. |
If multiple JVMs are implemented (ie: Jserv(R12应该mod-OC4J) load balancing -multiple JVMs in a single box-, HTTP Load balancing -Multiple Web Servers connecting to the same instance- or a combination of both), it is important to note that each JVM will create its own JDBC Pool. Under these circumstances, it’s very difficult to troubleshoot what the problem is, since some users might be getting errors when trying to obtain connections from the pool, while when trying to use the diagnostics tools provided to troubleshoot the problem, a different JVMs could be accessed, obtaining the wrong results for the tests.
he connection pool parameters are summarized in the following table, and discussed in detail below.
Category | Parameter | Meaning | Allowed Values | Default value |
---|---|---|---|---|
Pool Size | FND_MAX_JDBC_CONNECTIONS | The maximum pool size. This is the sum of the number of available connections and the number of locked connections. | positive integers less than Integer.MAX | Integer.MAX |
FND_JDBC_BUFFER_MIN | Minimum buffer size to maintain. (SessionManager.java 115.116) |
positive integers less than Integer.MAX | 5 | |
FND_JDBC_BUFFER_MAX | Maximum buffer size to maintain. (SessionManager.java 115.116) |
positive integers less than Integer.MAX. A percent sign can be appended to the integer to indicate that the buffer maximum should be calculated dynamically as a percent of total pool size. | 50% | |
Thread | FND_JDBC_BUFFER_DECAY_INTERVAL | How often the maintenance thread should check buffer size (in seconds). (SessionManager.java 115.116) |
positive integers less than Integer.MAX | 60 seconds |
FND_JDBC_BUFFER_DECAY_SIZE | The maximum number of available objects that should be removed during any one thread cycle. (SessionManager.java 115.116) |
positive integers less than Integer.MAX | 1 | |
Selection | FND_JDBC_MAX_WAIT_TIME | The maximum wait time. This is the maximum amount of time that a client should use trying to get a connection. | Not user configurable. | 10 seconds |
FND_JDBC_SELECTION_POLICY | The selection policy used to select connections from the available list. | Not user configurable. | Pool.COST (cost-based) |
|
Safety Check | FND_JDBC_USABLE_CHECK | Indicates whether the a simple pl/sql query should be performed to check whether the connection is usable before giving a connection to the client. (DBConnObj.java 115.12) |
true or false | true |
FND_JDBC_CONTEXT_CHECK | Indicates whether the AOL security context and NLS state should be obtained from the database server session instead of the java client when the connection is returned to the pool. (DBConnObj.java 115.12) |
true or false | true | |
FND_JDBC_PLSQL_RESET | Indicates whether the PL/SQL state should be freed before the pool gives the connection to the client. (DBConnObj.java 115.12) |
true or false | false |
FND_MAX_JDBC_CONNECTIONS
The maximum pool size is the maximum allowed sum of the number of available connections and the number of locked connections. If the pool reaches the maximum size and all connections are locked, new clients will not be able to borrow a connection until one of the current clients has returned one. The default setting for this parameter is essentially unlimited (about 2 billion).
FND_JDBC_BUFFER_MIN
The buffer minimum is the minimum number of connections that the pool should try to maintain in the available list. When the buffer size falls below the buffer minimum, the pool maintenance thread will be notified to create new connections. When notified, the thread will immediately attempt to create the number of connections to fill the difference. New connections will not be created if the pool is already at its maximum size. When creating new connections the thread uses the attributes of the most recent client request that resulted in a new connection being created.
Setting this parameter to "0" will disable maintenance of the buffer minimum. However, the buffer maximum will still be maintained.
Setting this parameter to a number greater than the maximum pool size (FND_MAX_JDBC_CONNECTIONS) will disable all buffer maintenance.
See Buffer Maintenance.
FND_JDBC_BUFFER_MAX
The buffer maximum is the maximum number of connections that the pool should try to maintain in the available list. During heavy usage, the buffer may exceed this maximum. However, during periods of low usage, the maintenance thread will decrease the buffer size until the buffer maximum is reached.
If the value of this parameter is an integer, (for example "20") the buffer maximum is static. If the value is a percent (for example, "20%"), the buffer maximum is not constant but instead is calculated dynamically as a percent of total pool size. The buffer minimum is also taken into account when determining a dynamic buffer maximum. The exact expression used is: