Stale connection causes ConnectionClosed exception during inbound ordered delivery for WebSphere Adapter for JDBC

Technote (troubleshooting)


Problem(Abstract)

Connection is closed by WebSphere Application Server due to an XAException from the database.

Symptom

An XAException is thrown:
---------------------------------------------------------------------------------------------------------------------------------------------------------
Connection handle : com.ibm.ws.rsadapter.jdbc.WSJdbcConnection@305a305a
Managed connection : WSRdbManagedConnectionImpl@d920d92

[4/8/13 4:51:13:118 PST] 0000007a WSRdbXaResour E DSRA0304E: XAException
occurred. XAException contents and details are:
The XA Error is : -7
The XA Error message is : Resource manager is unavailable.
The Oracle Error code is : 17002
The Oracle Error message is: Internal XA Error
The cause is : null.
[4/8/13 4:51:13:118 PST] 0000005a WSRdbXaResour 3 fire normal connection
error occurred event for XAResource
com.ibm.ws.rsadapter.spi.WSRdbXaResourceImpl@4d0f4d0f
[4/8/13 4:51:13:118 PST] 0000005a WSJdbcConnect > close Entry

com.ibm.ws.rsadapter.jdbc.WSJdbcConnection@305a305a
[4/8/13 4:51:13:118 PST] 0000005a WSRdbManagedC 1 Firing
CONNECTION_ERROR_OCCURRED event for handle: null
WSRdbManagedConnectionImpl@d920d92
---------------------------------------------------------------------------------------------------------------------------------------------------------

During the prepareStatement() call from JDBC adapter, the oracle jdbc driver throws a XA
Error and the reason is the "Resource manager is unavailable.". Upon
the XA exception, WebSphere RRA component treats it as a fatal connection
error, marks the connection as stale and based on the purge policy (Entire
Pool), purges the connection pool. At the same time, connection handle is
also closed.

com.ibm.websphere.ce.cm.ObjectClosedException: DSRA9110E: Connection is
closed. : This exception is an outcome of the OracleXAException as the
connection handle is closed upon detecting a fatal connection error
and in the prepareStatemen() exception handling logic when WAS detect the
state of the connection as closed, its throw an ObjectClosedException.
After the XAException and the connection handle being closed,JDBC adapter tries to use same connection that is closed and this again results in an ObjectClosedException.

Below is the objectClosedException thrown:

---------------------------------------------------------------------------------------------------------------------------------------------------------

[3/5/13 5:41:20:088 PST] 00000085 WSJdbcConnect > prepareStatement Entry

com.ibm.ws.rsadapter.jdbc.WSJdbcConnection@305a305a
SELECT "EVENT_ID", "WHSE_ID", "PRTNUM",
"PRT_CLIENT_ID", "ORGFLG"

[3/5/13 5:41:20:094 PST] 00000085 InternalGener >
isAnAuthorizationException: Entry

com.ibm.websphere.ce.cm.ObjectClosedException: DSRA9110E: Connection is
closed.
at com.ibm.ws.rsadapter.jdbc.WSJdbcWrapper.createClosedException
(WSJdbcWrapper.java:110)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.activate
(WSJdbcConnection.java:2854)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.prepareStatement
(WSJdbcConnection.java:2745)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.prepareStatement
(WSJdbcConnection.java:2713)
at com.ibm.j2ca.jdbc.JDBCDBOperationHandler.executeRSQL
(JDBCDBOperationHandler.java:915)
---------------------------------------------------------------------------------------------------------------------------------------------------------



Resolving the problem

A new activation spec property named - useConnectionPoolForPolling is added to the activation spec in order to resolve this problem. If the property is set to true, adapter uses a new connection from the connection pool for each event. This resolves the stale connection issue. However enabling the property to true will have impact on the performance of the adapter. For example, the rate of processing of events by the adapter may decrease. If the property is set to false the adapter will behave the same as before, and will not create a new connection for each event. This issue has been resolved in JDBC adapter Interim Fix v7.5.0.3_IF02.

Rate this page:

(0 users)Average rating

Add comments

Document information


More support for:

WebSphere Adapters
Adapter for JDBC

Software version:

7.5

Operating system(s):

AIX, Linux, Solaris, Windows

Software edition:

WebSphere

Reference #:

1632918

Modified date:

2013-04-01

Translate my page

Machine Translation

Content navigation