users@connector-spec.java.net

[connector-spec-users] [jsr322-experts] Re: javax.resource.spi.ManagedConnection API

From: Jesper Pedersen <jesper.pedersen_at_redhat.com>
Date: Wed, 16 Jan 2013 12:03:22 -0500

Hi,

On 01/16/2013 10:45 AM, frowe_at_us.ibm.com wrote:
> In order to facilitate resource adapter failover mechanisms from one
> resource adatper to another, it is useful to be able to determine the
> state of a connection so that if the connection has failed, a failover
> process can be performed. Similarly, when the connection state
> indicates that the connection is working again, an automated (or
> manual) failback process could be initiated. One means to acheive this
> would be to add a testConnection(...) method to the MC API allowing a
> standard means for the app server to determine the status of a
> connection.
>

You should use

  ValidatingManagedConnectionFactory::getInvalidConnections()

to test the connection status.

Best regards,
  Jesper