PQ74409: UNEXPECTED CONNECTION CLOSE BY ORPHAN ALARM THREAD BEFORE EXECUTE STATEMENT & APPLICATION GOT STALECONNECTIONEXCEPTION.

 A fix is available

5.0.2: WebSphere Application Server Version 5.0 Fix Pack 2 (Version 5.0.2)



APAR status
Closed as program error.

Error description
There is very delicate timing which might cause this issue.
If number of used connection is 0, and then application get
connection from pool, it would be possible that connection is
closed by orphan alarm thread before executing statement.
In another words, application has possibility of getting
StaleConnectionException triggered by CM behavior,
however application and DB works fine.
.
Sequence:
1. There is no inuse connection on connection pool.
2. Orphan timeout passes
3. Application getconnection from pool.
4. before executing statement, if orphan time is passed again
   at this point, application will get StaleConnectionException.
   (because connection was closed by Orphan thread)
.
Below is sample output of CM trace. Connection was closed
before executing statement.
================================================================

■03/03/18 4:21:33:880 JST 1298fe02 WebGroup
I SRVE0091I: ■ServletLog: teststale3: TestStale3.service() No.3
get connection
■03/03/18 4:21:33:883 JST 1298fe02 DataSourceImp
> getConnection
■03/03/18 4:21:33:900 JST 1298fe02 DataSourceImp
< getConnection
&#65517;03/03/18 4:21:33:956 JST&#65529;  1967e06 ConnectionPoo
> alarm
&#65517;03/03/18 4:21:33:957 JST&#65529;  1967e06 ConnectO
> checkForOrphan
&#65517;03/03/18 4:21:33:958 JST&#65529;  1967e06 ConnectionPoo
E connectionOrphaned
&#65517;03/03/18 4:21:33:959 JST&#65529;  1967e06 ConnectionPro
> connectionOrphaned
&#65517;03/03/18 4:21:33:960 JST&#65529;  1967e06 ConnectionPro
> close
&#65517;03/03/18 4:21:33:961 JST&#65529;  1967e06 Proxy
> close
&#65517;03/03/18 4:21:33:962 JST&#65529;  1967e06 Proxy
D Mark proxy closed
&#65517;03/03/18 4:21:33:963 JST&#65529;  1967e06 Proxy
< close
&#65517;03/03/18 4:21:33:971 JST&#65529;  1967e06 ConnectionPro
< close
&#65517;03/03/18 4:21:33:972 JST&#65529;  1967e06 ConnectionPro
< close
&#65517;03/03/18 4:21:33:972 JST&#65529;  1967e06 ConnectionPro
< connectionOrphaned
&#65517;03/03/18 4:21:33:973 JST&#65529;  1967e06 ConnectO
W CONM6020W: A Connection has been Orphaned and returned
to pool TestDataSource.
&#65517;03/03/18 4:21:34:282 JST&#65529;  1967e06 ConnectO
< checkForOrphan
&#65517;03/03/18 4:21:34:283 JST&#65529;  1967e06 ConnectionPoo
< alarm
================================================================
Local fix Problem summary
****************************************************************
* USERS AFFECTED: Customers using WebSphere Application Server *
*                 4.0 and WebSphere connection pooling.        *
****************************************************************
* PROBLEM DESCRIPTION: Connections may be closed due to an     *
*                      incorrect orphan timeout.  This         *
*                      results in a StaleConnectionException   *
*                      with a message of "The Connection is    *
*                      closed" being thrown when the           *
*                      application uses the connection.        *
****************************************************************
* RECOMMENDATION:                                              *
****************************************************************
A timing window existed where if a connection was removed from
the connection pool with a getConnection() call, but no work was
done on the connection before the orphan timer went off, the
connection would be incorrectly detected as an orphaned
connection and returned to the free pool.  When the application
did attempt to do work on the connection, a
StaleConnectionException would occur.
Problem conclusion
Fixed the orphan timeout logic so that when a connection is
retrieved from the pool, the orphan timer is reset.
Temporary fix Comments
APAR information
APAR number PQ74409
Reported component name WAS BASE 5.0
Reported component ID 5630A3600
Reported release 00W
Status CLOSED PER
PE NoPE
HIPER NoHIPER
Special Attention NoSpecatt
Submitted date 2003-05-21
Closed date 2003-05-21
Last modified date 2003-05-21

APAR is sysrouted FROM one or more of the following:
PQ72406

APAR is sysrouted TO one or more of the following:

Modules/Macros
JDBC          

Publications Referenced

Fix information
Fixed component name WAS BASE 5.0
Fixed component ID 5630A3600

Applicable component levels
R00A PSY    UP
R00I PSY    UP
R00H PSY    UP
R00S PSY    UP
R003 PSY    UP
R00W PSY    UP


Document Information


Product categories: Software > Application Servers > Distributed Application & Web Servers > WebSphere Application Server > General
Operating system(s):
Software version: 00W
Software edition:
Reference #: PQ74409
IBM Group: Software Group
Modified date: May 21, 2003