Implementing failover in jConnect

Implement failover support in jConnect using one of the following two methods:


Logging in to the primary server

If an Adaptive Server is not configured for failover or cannot grant a failover session, the client cannot log in, and the following warning displays:

'The server denied your request to use the high-
availability feature.

Please reconfigure your database, or do not request a
high-availability session.'

Failing over to the secondary server

When failover occurs, the SQL exception JZ0F2 is thrown:

‘Sybase high-availability failover has occurred. The
current transaction is aborted, but the connection is
still usable. Retry your transaction.’

The client then automatically reconnects to the secondary database using JNDI.

Note that:


Failing back to the primary server

At some point, the client fails back from the secondary server to the primary server. When failback occurs is determined by the System Administrator who issues sp_failback on the secondary server. Afterward, the client can expect the same behavior and results on the primary server as documented in “Failing over to the secondary server”.