Monitore For Connection Leaks within the WebLogic Console
Oracle WebLogic
Server provides monitoring options to system administrators for JDBC
connections.
To set up and
monitor these options, follow these steps.
- Log in to the WebLogic Console,
which is typically at machine.domain:port/console. If you are
unsure of the port number, review the context
variable s_wls_adminport.
- Navigate to to Services
(Tree Link) -> Data Sources (Tree Link) -> EBSDataSource (Page Link)
-> Monitoring (Tab).
- Click on Customize This Table.
Move the options required from Available to Chosen.
- Suggested values:
- Active Connections
- Current Count
- Current Capacity
- Leaked Connection Count
- Number Available
- Number Unavailable
- Press Apply.
Note: Leaked
Connection Count will need the Inactive Connection Timeout (ICT) parameter to
be turned on. By default, it is turned off to cater for the dedicated
connections that need to remain idle within an Oracle E-Business Suite managed
server. Therefore, enabling the Inactive Connection Timeout parameter is only
recommended during the debugging of suspected connection leaks.
Before enabling ICT,
verify the version of OAConnectionPoolManagerImpl.class is 120.7.12020000.2 or
higher.
For example:
$ adident Header
$OA_JAVA/oracle/apps/fnd/framework/server/OAConnectionPoolManagerImpl.class
$Header
OAConnectionPoolManagerImpl.java 120.7.12020000.2 2015/02/10 09:19:45 spunam
ship $
If it is at a
lower version than 120.7.12020000.2, apply Patch 21619282.
Inactive Connection Timeout
The number of
inactive seconds on a reserved connection before WebLogic Server reclaims the
connection and releases it back into the connection pool.
You can use the
Inactive Connection Timeout feature to reclaim leaked connections - connections
that were not explicitly closed by the application. Note that this feature is
not intended to be used in place of properly closing connections.
When set to 0,
the feature is disabled.
Minimum value: 0
Maximum value:
2147483647
To set the Inactive Connection Timeout parameter,
follow these steps.
- Login to the WebLogic Server
console, which is typically at machine.domain.port:7001/console.
The port number can be found by examining the s_wls_adminport variable
in the context file.
- Navigate to Services (Tree
Link) -> Data Sources (Tree Link) -> EBSDataSource (Page Link)->
Connection Pool (tab) -> Advanced (Expand Arrow).
- Click on the Lock and Edit
Button in the top left hand corner of the screen.
- Update the Inactive
Connection Timeout to the desired value in seconds: for example, a setting
of 3600 for one hour.
- Monitor the system, and after
two iterations review the following files from the run file system.
- $EBS_DOMAIN_HOME/servers/servername/logs/managed_server#.log
and $EBS_DOMAIN_HOME/servers/servername/logs/managed_server#.out files.
- If multiple managed servers
are deployed in different nodes, obtain the above files for each defined
managed server.
- A change to the DataSource
will affect all target servers (in a cluster).
- Within the log files, look for
Oracle WebLogic Server message number BEA-001153.
- For example, the following
message and a stack trace specific to the connection are created when the
connection is closed by Inactive Connection Timeout:
####<Oct 27, 2014 3:10:33 PM PDT> <Warning>
<JDBC> <rws3220424> <oacore_server1> <[ACTIVE]
ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'>
<<WLS Kernel>> <> <55a558fff3133dee:65b5ca10:149539dd27e:-8000-000000000000006e>
<1414447833111> <BEA-001153> <Forcibly releasing
inactive/harvested connection
"weblogic.jdbc.wrapper.PoolConnection_oracle_jdbc_driver_T4CConnection@31e8"
back into the data source connection pool "EBSDataSource", currently
reserved by: java.lang.Exception
- Example stack from a known
issue:
at
weblogic.jdbc.common.internal.ConnectionEnv.setup(ConnectionEnv.java:366)
at
weblogic.common.resourcepool.ResourcePoolImpl.reserveResource(ResourcePoolImpl.java:373)
at
weblogic.common.resourcepool.ResourcePoolImpl.reserveResource(ResourcePoolImp @
l.java:339)
at
weblogic.jdbc.common.internal.ConnectionPool.reserve(ConnectionPool.java:469)
at weblogic.jdbc.common.internal.ConnectionPool.reserve(ConnectionPool.java:363)
at
weblogic.jdbc.common.internal.ConnectionPoolManager.reserve(ConnectionPoolManager.java:125)
at
weblogic.jdbc.common.internal.RmiDataSource.getPoolConnection(RmiDataSource.java:454)
at weblogic.jdbc.common.internal.RmiDataSource.getConnectionInternal(RmiDataSource.java:538)
at
weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:498)
at sun.reflect.GeneratedMethodAccessor142.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at
oracle.apps.fnd.security.DBConnObjWLSDSPool.getConnection(DBConnObjWLSDSPool.java:373)
at
oracle.apps.fnd.security.AppsConnectionManagerWLSDS.dbConnect(AppsConnectionManagerWLSDS.java:223)
at
oracle.apps.fnd.security.AppsConnectionManagerWLSDS.localAppsConnect(AppsConnectionManagerWLSDS.java:193)
at
oracle.apps.fnd.security.AppsConnectionManagerWLSDS.makeGuestConnection(AppsConnectionManagerWLSDS.java:68)
at oracle.apps.fnd.security.DBConnObj.getLabelledConnection(DBConnObj.java:314)
at oracle.apps.fnd.security.DBConnObj.<init>(DBConnObj.java:233)
at oracle.apps.fnd.security.DBConnObjDS.<init>(DBConnObjDS.java:98)
at sun.reflect.GeneratedConstructorAccessor140.newInstance(Unknown @ Source)
You can run the
following SQL to obtain additional information about connection usage.
set lines 132
set pages 500
column module
heading "Module Name" format a48;
column machine
heading "Machine Name" format a25;
column process
heading "Process ID" format a10;
prompt
prompt Connection
Usage Per process and module
prompt
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
select count(*),
machine, process, module from gv$session where program like '%JDBC%' group by
machine, process, module order by 3 asc;
Save
this as a .sql file, for example ict.sql, then execute it:
Note:
If you are on a lower codelevel than TXK Delta 6, do not run this SQL as the
results will be unreliable. Instead, review My Oracle Support Knowledge
Document 1958352.1, On E-Business Suite 12.2 V$SESSION.PROCESS incorrectly
reports EBS Client Process ID as '1234'.
Example stack trace from a
known issue:
at
weblogic.jdbc.common.internal.ConnectionEnv.setup(ConnectionEnv.java:366)
at weblogic.common.resourcepool.ResourcePoolImpl.reserveResource(ResourcePoolImpl.java:373)
at
weblogic.common.resourcepool.ResourcePoolImpl.reserveResource(ResourcePoolImp @
l.java:339)
at
weblogic.jdbc.common.internal.ConnectionPool.reserve(ConnectionPool.java:469)
at
weblogic.jdbc.common.internal.ConnectionPool.reserve(ConnectionPool.java:363)
at
weblogic.jdbc.common.internal.ConnectionPoolManager.reserve(ConnectionPoolManager.java:125)
at weblogic.jdbc.common.internal.RmiDataSource.getPoolConnection(RmiDataSource.java:454)
at
weblogic.jdbc.common.internal.RmiDataSource.getConnectionInternal(RmiDataSource.java:538)
at
weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:498)
at sun.reflect.GeneratedMethodAccessor142.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at
oracle.apps.fnd.security.DBConnObjWLSDSPool.getConnection(DBConnObjWLSDSPool.java:373)
at oracle.apps.fnd.security.AppsConnectionManagerWLSDS.dbConnect(AppsConnectionManagerWLSDS.java:223)
at
oracle.apps.fnd.security.AppsConnectionManagerWLSDS.localAppsConnect(AppsConnectionManagerWLSDS.java:193)
at oracle.apps.fnd.security.AppsConnectionManagerWLSDS.makeGuestConnection(AppsConnectionManagerWLSDS.java:68)
at oracle.apps.fnd.security.DBConnObj.getLabelledConnection(DBConnObj.java:314)
at oracle.apps.fnd.security.DBConnObj.<init>(DBConnObj.java:233)
at oracle.apps.fnd.security.DBConnObjDS.<init>(DBConnObjDS.java:98)
at sun.reflect.GeneratedConstructorAccessor140.newInstance(Unknown @ Source)
The below patches
are recommended for these connection leak and many other framework related
issues.
For 12.2.x, with Delta
6
-Apply the following patches if not already
applied:
19494816 - connection leak on ErrorStack.java,
fix released -- AOL
19807163 - transactionscope - connection leak in
12.2.4 -- Oracle Applications Manager
19858552 - npe during error handling, fix
released (12.2.4) – OAF
Might have to apply below patches as well and
see if it can fix the issue
-Please use How To Check If a Patch is Applied
in 12.2.x ( Doc ID 1963046.1 )
20034256
20043910
19891697
19494816
19807163
19858552
18886213
19782999