When we create a datasource in websphere and it is assigned to application . During the odd situation where network glitch or what ever so reason if there is a problem and the connection assigned to the application goes stale then will get the below error .
com.ibm.websphere.ce.cm.StaleConnectionException: Io exception: Broken pipe
How to enable database connection testing in WebSphere
To have WebSphere automatically check the validity of a connection when serving it up from the connection pool do the following:
- In the administrative console, click Resources > JDBC providers.
- Select a provider and click Data Sources under Additional properties.
- Select a data source and click WebSphere Application Server data source properties under Additional properties.
- Select the PreTest Connections check box.
- Type a value for the PreTest Connection Retry Interval, which is measured in seconds. This property determines the frequency with which a new connection request is made after a pretest operation fails.
- Type a valid SQL statement for the PreTest SQL String. Use a reliable SQL command, with minimal performance impact; this statement is processed each time a connection is obtained from the free pool.