Enabling Sybase Failover

To support Sybase Failover, add code to the existing CMs. See the cml.c sample in $OPENSWITCH/sample/ on UNIX and %OPENSWITCH%\sample\ on Windows, under the cm_srvreq_hdl function under the case for COORD_R_HAFAILOVER. Add this code to the CM:

case COORD_R_HAFAILOVER:
      if (cm_set_srv(cm, req->spid, req->cur_server) !=CS_SUCCEED)
      {
              fprintf(stderr, “cm1: Unable for spid ‘%d’ to stay put on the
                     current server\n”, (int) req->spid);
       }
        break;

This code segment sets the server name. In a multicluster environment, the CM is notified of a failover event only when the entire primary Adaptive Server® Enterprise cluster fails. The CM is not notified when the primary node of the Adaptive Server cluster fails, as connections are automatically redirected to the secondary node without consulting the CM.