Sun Java System Application Server Enterprise Edition 8.1 2005Q2 Developer's Guide

- Previous: Testing a Connection Pool
- Next: Setting the Shutdown Timeout

## Handling Invalid Connections

If a resource adapter generates a `ConnectionErrorOccured` event, the Application Server considers the connection invalid and removes the connection from the connection pool. Typically, a resource adapter generates a `ConnectionErrorOccured` event when it finds a `ManagedConnection` object unusable. Reasons can be network failure with the EIS, EIS failure, fatal problems with resource adapter, and so on. If the `fail-all-connections` property in the connection pool configuration is set to `true`, all connections are destroyed and the pool is recreated.

You can set the `fail-all-connections` configuration property during creation of a connector connection pool. Or, you can use the `asadmin set` command to dynamically reconfigure a previously set property. For details, see the Sun Java System Application Server Enterprise Edition 8.1 2005Q2 Reference Manual.

The interface `ValidatingManagedConnectionFactory` exposes the method `getInvalidConnections` to allow retrieval of the invalid connections. The Application Server checks if the resource adapter implements this interface, and if it does, invalid connections are removed when the connection pool is resized.

- Previous: Testing a Connection Pool
- Next: Setting the Shutdown Timeout

- © 2010, Oracle Corporation and/or its affiliates