Solution to leakage problem of weblogicconnection leak connection pool

Source: Internet
Author: User
Tags connection pooling stack trace
The default WebLogic is not to record this leak log, only to report JDBC errors.
The following part of the reprint, part of the actual encounter, but the resolution of the same steps, the original address: http://blog.csdn.net/esky2000/archive/2008/07/22/2689929.aspx
1, modify
Login to WebLogic console,%domain%-> Services-> JDBC-> Connection Pools-> Jdbc/ioa
Configuration page-> Connection, click to open Advanced Options, modify the following configuration item status:
Configuration Item Name
Default value
Amended to
Description
Enable Connection Leak Profiling
Disable
Enable
Open the connection pool leak monitoring.
Enable Connection Profiling
Disable
Enable
Turn on connection pooling monitoring.
Inactive Connection Timeout
0
100
If the connection is inactive for a specified period of time (in seconds), WebLogic releases it and returns it to the connection pool.
2, the above configuration changes do not affect the running of the application, do not need to restart the server or application (configuration items before the small yellow icon <!--[if!vml]--><!--[Endif]--> WebLogic very clearly told us that this configuration is not required to reboot, so can be assured that the setting. Just enable monitoring will have some impact on performance, the specific impact will be how much, I have not tested, but to open these settings is only temporary, after the log we can restore the configuration will be the default value.
In the absence of a solution to the connection pool leakage problem, if there is no request, the connection pool will remain 0, there will be no connection pool full of requests can not respond to the problem, we do not have to worry about the customer scolded, but also for us to solve the problem for the valuable time.
Well, here's the key.
After a while, in the Bea/user_projects/domains/%domainname%/%servername% directory, open%servername%.log, Find, "A JDBC pool connection leak Was detected ", if WebLogic has been monitoring the connection pool leak, you can find the following log, and clearly tell us which line of the class the code created the connection, but did not close (note red bold font):
2008-5-22 11:47 A.M. 20 sec CST Warning jdbc A jdbc Pool connection leak was detected. A connection leak occurs when a connection obtained from the pool is not closed explicitly by calling Close () and then WA s disposed by the garbage collector and returned to the connection pool. The following stack trace at create shows where the leaked connection is created. Stack Trace at Connection create:
At Weblogic.jdbc.wrapper.PoolConnection.init (poolconnection.java:75)
At Weblogic.jdbc.pool.Driver.allocateConnection (driver.java:254)
At Weblogic.jdbc.pool.Driver.connect (driver.java:84)
At Weblogic.jdbc.jts.Driver.getNonTxConnection (driver.java:546)
At Weblogic.jdbc.jts.Driver.connect (driver.java:140)
At Weblogic.jdbc.common.internal.RmiDataSource.getConnection (rmidatasource.java:344)
At Com.cp.fw.dao.BaseDAO.getConnection (basedao.java:78)
At Com.cp.fw.dao.dataset.DataSetOp.init (datasetop.java:78)
At Com.cp.fw.dao.dataset.datasetop.<init> (datasetop.java:45)
At Com.cp.ia.util.WorkFlowUtil.getNextWrokFlowId (workflowutil.java:93)
At

Another method:
In WebLogic Console, expand%domainname%-> Servers->%servername%, select the Logging–server page, click "View Server Log" at the bottom of the page, and look for "A" JDBC Pool connection leak was detected ", you can also find the same log.
WebLogic Description of Log events:
Message ID
BEA-001074
Subsystem
Jdbc
Message
A JDBC Pool connection leak was detected. A
Connection leak occurs when a connection obtained
From the pool is not closed explicitly by calling
Close () and then is disposed by the garbage
Collector and returned to the connection pool. The
Following stack trace at create shows where the
Leaked connection was created. Stack Trace at
Connection Create:
Detail
A JDBC Pool connection leak was detected. A
Connection leak occurs when a connection obtained
From the pool is not closed explicitly by calling
Close () and then is disposed by the garbage
Collector and returned to the connection pool. A
Stack trace is printed indicating where the leaked
Connection was created.
Cause
A JDBC Pool connection leak was detected. A
Connection leak occurs when a connection obtained
From the pool is not closed explicitly by calling
Close () and then is disposed by the garbage
Collector and returned to the connection pool. A
Stack trace is printed indicating where the leaked
Connection was created.
Action
Close the connection appropriately
Through some of the previous operations, we can check the bug in our program, by correcting the bug, we can finally solve the connection pool leakage problem ~

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.