Solutions for java.sql.SQLRecoverableException:Closed connection anomalies (RPM)

Source: Internet
Author: User

In the project encountered an application exception, from the appearance of the application of zombies. View WebLogic status is running, memory is not overflow, but there are multiple thread jams. View the WebLogic log and discover that the program appears multiple times out.

We know that WebLogic will automatically detect the thread running timeout when it exceeds the feature time (default 600S), that is to say that this thread is clogging the thread. Found in the log a number of blocked threads, by looking for data, found that weblogic after multiple threads blocked, will automatically suspend the application. The default number is 15 times.

What caused the thread to clog? By further analyzing the log, we found that there were multiple java.sql.SQLRecoverableException:Closed connection exceptions before the thread was blocked. Exception Condition:

From the performance point of view, the database is connected with an exception. We analyzed the database and the network to make sure that neither the database nor the network was abnormal. One of our other applications is running in WebLogic with no similar problem.

Finally, we found the root knot of the problem on Oracle's forum, because our application is a database connection pool developed by ourselves, and there is a layer of firewall between the application and the database. The firewall policy is to automatically shut down the socket connection that is not used for 1800s. The exception that the socket was unexpectedly closed was also found in the Oracle log. We have adjusted the application to automatically recycle and solve problems when the connection in the connection pool is not used for 15 minutes.

http://blog.csdn.net/gavinloo/article/details/12206763

JDK1.6:
java.sql
Interface Statement:
SetQueryTimeout
SetQueryTimeout (int seconds)                     Throws SQLException
Sets the number of seconds the driver would wait for an object to execute to the given number of
Statement seconds. If the limit is exceeded, a is SQLException thrown. A JDBC driver must apply this limit execute to the, executeQuery and executeUpdate methods. JDBC driver implementations may also apply this limit to ResultSet methods (consult your driver vendor documentation for DET ails).

Parameters:
seconds-The new query timeout limit in seconds; Zero means there is no limit
Throws:
SQLException-If a database access error occurs, this method was called on a closed Statement or the condition seconds >= 0 is not s Atisfied
See Also:
getQueryTimeout()
 

Solutions for java.sql.SQLRecoverableException:Closed connection anomalies (RPM)

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.