My Oracle Support Banner

JDBC Causes WebLogic Server Hang Support Pattern (Doc ID 1135278.1)

Last updated on MARCH 05, 2024

Applies to:

Oracle WebLogic Server - Version 6.1 and later
Information in this document applies to any platform.

Purpose

This document discusses how to troubleshoot and fix WebLogic Server hang caused by JDBC configuration and related resources.

Problem Description

A JDBC connection which is used by an application or by WebLogic Server itself will block one WebLogic Server execute thread for the complete duration of the calls that are made via this connection. The JVM will ensure that the CPU is given to runnable threads by its thread scheduling mechanism, while the thread that blocks on a SQL query needs to wait. However, the thread occupied by the JDBC call will be reserved and used for the application until the call returns from the SQL query.

Even a transaction timeout will not kill or timeout any action that is done by the resources that are enlisted in this transaction. The actions will run as long as they take, without interruption. A transaction timeout will set a flag on the transaction that will mark it as rollback only, so that any subsequent request to commit this transaction will fail with a TimedOutException or RollbackException. However, as mentioned above, the long running JDBC calls can lead to blocked WebLogic Server execute threads, which can finally lead to a hanging instance, if all threads are blocked and no execute thread remains available for handling incoming requests.

More recent WebLogic Server versions have a health check functionality that regularly checks if a thread does not react for a certain period of time (the default is 600 seconds). If this happens, an error message is printed to your log file similar to following:

The time interval for the health check functionality is configurable. Please check the StuckThreadMaxTime property in the <Server> tag of your config.xml file: https://download.oracle.com/docs/cd/E13222_01/wls/docs81/config_xml/Server.html#StuckThreadMaxTime or the "Detecting stuck threads" section in the WebLogic Server administration console help: https://download.oracle.com/docs/cd/E13222_01/wls/docs81/perform/WLSTuning.html#stuckthread.

Problem Troubleshooting

Different programming techniques or JDBC connection pool configurations can lead to deadlocks or long running JDBC calls that lead to hanging WebLogic Server instances. General information about how to troubleshoot and analyze a hanging WebLogic Server instance is provided in the Generic Server Hang Pattern (<note 782125.1>).

This pattern addresses JDBC calls causing a server hang and other well-known JDBC-related causes for common problems leading to hanging WebLogic Server instance.

Troubleshooting Steps

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Purpose
 Problem Description
 Problem Troubleshooting
Troubleshooting Steps
 Why does the problem occur?
 Synchronized DriverManager.getConnection()
 Long-Running SQL Queries
 Hanging Database
 Slow Network
 Deadlock
 RefreshMinutes or TestFrequencySeconds
 Pool Shrinking
 Analysis of a hanging WebLogic Server instance
 Tips and Tricks to optimize your JDBC code and JDBC connection pool configuration
 JDBC Programming
 JDBC Connection Pool Configuration
 Known Issues
 Need further help?
References

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.