AOL/J JDBC连接在EBS中的实现

参考文档: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: 
 

  • maximum(t) =  buffer minimum + ( (FND_JDBC_BUFFER_MAX/100)  * size(t) )

where maximum(t) and size(t) are the buffer maximum and pool size at some time t.
The thread is configured to periodically check the buffer size.  If the buffer size is greater than the maximum, the thread will remove either the number of available connections specified by FND_JDBC_BUFFER_DECAY_SIZE or the number of connections in excess of the buffer minimum, whichever is smaller.  When connections are removed from the available list, the least recently used ones are removed first.
Setting this parameter to100%, or to a number equal to FND_MAXIMUM_JDBC_CONNECTIONS, or to a number less than or equal to FND_JDBC_BUFFER_MIN will effectively prevent the maintenance thread from ever removing any connections.
See Buffer Maintenance.
FND_JDBC_BUFFER_DECAY_INTERVAL
The buffer decay interval specifies how often the connection pool maintenance thread should check the buffer size.  The thread will check the buffer size at most once every FND_JDBC_BUFFER_DECAY_INTERVAL seconds.  The actual time between consecutive thread cycles will vary somewhat depending on the JVM load.
This parameter, along with FND_JDBC_BUFFER_DECAY_SIZE, allows the buffer decay rate to be tuned.  For example, if the buffer decay size is 2 and the buffer decay interval is one minute, the buffer decay rate will never exceed two connections per minute.  When connections are removed, the least recently used ones are removed first.
See Buffer Maintenance.
FND_JDBC_BUFFER_DECAY_SIZE
The buffer decay size specifies the maximum number of connections that should be removed during any single thread cycle during which the number of available connections is greater than the buffer size.  This parameter, along with FND_JDBC_BUFFER_DECAY_INTERVAL, allows the buffer decay rate to be tuned.
See Buffer Maintenance.
FND_JDBC_MAX_WAIT_TIME
The maximum wait time specifies how much time a client should spend trying to get a connection.  The borrow algorithm, used to borrow an object from the pool, contains check points at which the elapsed time is compared to the maximum wait time.  If it exceeds the maximum wait time, then a null object will be returned to the client.  The pre-configured value for the maximum wait time is 10 seconds.
FND_JDBC_SELECTION_POLICY
The selection policy determines how a connection is selected from the list of available connections for a particular client.  The connection pool is pre-configured to use a cost-based selection algorithm, which selects the connection that will require the smallest amount of initialization to match the client's context.
FND_JDBC_USABLE_CHECK
The FND_JDBC_USABLE_CHECK parameter governs whether a pl/sql query is performed before giving a connection to a client. The pool checks whether a connection is usable before handing it to a client. This always involves checking that the connection is not null and is not closed. If FND_JDBC_USABLE_CHECK is set to true, then it also verifies that the connection can be used to perform a simple PL/SQL query. (This parameter may have to be set to "true" in order to clean up connections to a database that has been restarted.)
The table below summaries the affect of FND_JDBC_USABLE_CHECK and the other safety check parameters on borrowing a connection from the pool.
FND_JDBC_CONTEXT_CHECK
The FND_JDBC_CONTEXT_CHECK parameter governs whether the AOL security context and NLS state is obtained from the database when the connection is returned to the pool.  If FND_JDBC_CONTEXT_CHECK is "true", when the connection is returned to the pool, the AOL security context and NLS state will be obtained from the database.  (This is implemented in the DBConnObj.isReusable() method).  This check must be done when the connection is returned (rather than when it is borrowed) so that the selection matching algorithm has access to the actual session context of the connections in the available list.
The table below summaries the affect of FND_JDBC_CONTEXT_CHECK and the other safety check parameters on borrowing a connection from the pool.
FND_JDBC_PLSQL_RESET
The PL/SQL reset flag, set using the variable FND_JDBC_PLSQL_RESET, governs whether the PL/SQL state associated with a connection should be freed before the pool hands the connection to the client.  By default this flag is false.  If the flag is set by true, by including the line "FND_JDBC_PLSQL_RESET=true" in the .dbc file, each connection to the database will have its PL/SQL state cleared before the pool returns the connection to the client.
This is how it works.  After the pool selects a connection from the available list for a client, it initializes the connection.  One of the things initialization does is to set a flag that is later used by SessionManager to determine if the apps initialization routine needs to be performed for the connection.  When FND_JDBC_PLSQL_RESET has been set to "true", this flag will always be set to true.  After the pool initializes the connection, it also checks whether the connection is usable.  In this case, this check will include a call to DBMS_SESSION.RESET_PACKAGE, which frees the PL/SQL state.  The table below summaries the affect of FND_JDBC_PLSQL_RESET and the other safety check parameters on borrowing a connection from the pool.
The FND_JDBC_PLSQL_RESET parameter has been added to only to address the case where production PL/SQL global bugs are known to exist.  The performance of the pool is reduced by setting this flag to true.

  • Pool Safety Checks
  • The following table shows the affect on default connection pool operations of setting each "safety check" parameter to true.  If the check causes extra database round trips, it is noted as "+n DBRT", where "n" is  the number of additional round trips. 
时间: 2024-09-21 18:48:03

AOL/J JDBC连接在EBS中的实现的相关文章

JDBC连接MySQL数据库及演示样例

JDBC是Sun公司制定的一个能够用Java语言连接数据库的技术. 一.JDBC基础知识 JDBC(Java Data Base Connectivity,java数据库连接)是一种用于执行SQL语句的Java API,能够为多种关系数据库提供统一訪问,它由一组用Java语言编写的类和接口组成.JDBC为数据库开发者提供了一个标准的API,据此能够构建更高级的工具和接口,使数据库开发者能够用纯 Java API 编写数据库应用程序,而且可跨平台执行,而且不受数据库供应商的限制. 1.跨平台执行:

配置BEA WebLogic 8.1 JDBC连接

本文描述了BEA WebLogic 8.1 Server中各种与JDBC相关功能的配置.尽管我们使用了Oracle 8.1.7作为我们的示例数据库管理系统(DBMS),但是只要其他关系数据库提供通过JDBC的连接,就可以很容易地把一般性的概念转移到这些数据库上. JDBC是标准的Java API,几乎所有需要访问数据库的J2EE应用程序都直接或间接地使用了它.在BEA WebLogic 8.1中,配置JDBC连接包括创建和配置两个主要的工件--JDBC连接池和数据源.与这两个主要工件相关的是其他

Java web开发中要是用jdbc连接access数据库,连接url怎么写相对位置

问题描述 Java web开发中要是用jdbc连接access数据库,连接url怎么写相对位置 Java web开发中要是用jdbc连接access数据库,连接url怎么写相对位置,注意这里是jdbc方法连接 而不是jdbc-odbc 例如access数据库就在项目中(project文件夹下) 代码为: try { // 加载jdbc - odbc驱动 Class.forName("com.hxtt.sql.access.AccessDriver"); // 根据url创建连接实例 a

postgresql java问题-Postgresql java编程用jdbc连接,怎么样执行postgresql中 d 的查询指令

问题描述 Postgresql java编程用jdbc连接,怎么样执行postgresql中 d 的查询指令 请各位大神帮忙解决一下这个问题:"Postgresql java编程用jdbc连接,怎么样执行postgresql中 d 的查询指令"谢谢. 情况是这样: 我要把所有表的constraints的column找出来,但是我只能通过pg_indexes找到constraints的名字,只有通过d constraints_name 才能找到column,所有请教各位大神有没有解决方法

mysql-MyEclipse中MySQL的jdbc连接错误

问题描述 MyEclipse中MySQL的jdbc连接错误 在new新的数据库时候用testDriver检测驱动是否连通的时候提示 Error while performing database login with the MySQL driver:Access denied for user "admin@localhost"(using password : YES) 这是为什么啊 ?本人小白 求解答 解决方案 账号密码错误 检查账号对不对 解决方案二: admin@localh

spring 配置文件中dbcp连接池,jdbc连接池 引入 配置文件properties,但是不能用$符号引用里面的变量问题

spring 配置 注意红色字体 (1)懒加载要设为true,(2)引入配置文件  注意不能懒加载不能设为false,否则$不能引入配置文件中的变量 第一种配置 jdbc连接池 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3

JDBC连接各种数据库经验技巧集萃

技巧|数据|数据库 Java数据库连接(JDBC)由一组用 Java 编程语言编写的类和接口组成.JDBC 为工具/数据库开发人员提供了一个标准的 API,使他们能够用纯Java API 来编写数据库应用程序.然而各个开发商的接口并不完全相同,所以开发环境的变化会带来一定的配置变化.本文主要集合了不同数据库的连接方式. 一.连接各种数据库方式速查表 下面罗列了各种数据库使用JDBC连接的方式,可以作为一个手册使用. 1.Oracle8/8i/9i数据库(thin模式) Class.forName

浅析MySQL JDBC连接配置上的两个误区

相信使用MySQL的同学都配置过它的JDBC驱动,多数人会直接从哪里贴一段URL过来,然后稍作修改就上去了,对应的连接池配置也是一样的,很少有人会去细想这每一个参数都是什么含义.今天我们就来聊两个比较常见的配置--是否要开启autoReconnect和是否缓存PreparedStatement. 一.autoReconnect=true真的好用么? 笔者看到过很多MySQL的URL里都是这样写的,复制过来改改IP.端口和库名就能用了: jdbc:mysql://xxx.xxx.xxx.xxx:3

JDBC连接Oracle数据库常见问题及解决方法

oracle|解决|数据|数据库|问题 Jbuilder正确连接 oracle 9i需要注意的几个问题 oracle8以上的应该都使用classes12.jar文件作为jdbc驱动: 正确设置windows的classpath和jbuilder中的enterprise setup .configure libraries,将casses12.jar路径正确添加到上述需要设置的地方: 进入database pilot,在database pilot中,file---new 在driver列表中如果