MonitorForFailover Method

Applies To

OraDatabase Object


Registers the failover notification handler of the application.


OraDatabase.MonitorForFailover FOSink, FOCtx


The arguments for the method are:

Arguments Description
[in] FOSink An IDispatch interface implementing the OnFailover method which is notified in event of a failover.
[in] FOCtx Context-specific information that the application wants passed into the OnFailover method in the event of a failover.


To receive failover notifications, a notification handler must be registered with the MonitorForFailover method. The notification handler must be an automation object (a class module in Visual Basic) that implements the OnFailover method.

The syntax of the method is:

Public Function OnFailover(Ctx As Variant, fo_type As Variant,fo_event as Variant, fo_OraDB as Variant) 
Variants Description
[in] Ctx Passed into the MonitorForFailover method by the application. Context-sensitive information that the application wants passed in event of a failover.
[in] fo_type Failover type. This is the type of failover that the client has requested. The values are:
  • OO4O_FO_SESSION indicates only session failover requested.

  • OO4O_FO_SELECT indicates select failover and session failover requested.



Failover event. This indicates the state of the failover. It has several possible values:
  • OO4O_FO_BEGIN indicates that failover has detected a lost connection and failover is starting.

  • OO4O_FO_END indicates successful completion of a failover.

  • OO4O_FO_ABORT indicates that a failover was unsuccessful, and there is no option of retrying.

  • OO4O_FO_ERROR indicates that a failover was unsuccessful, and gives the application the opportunity to handle the error and retry the failover. The application can retry the failover, by programming the OnFailover method to return OO4O_FO_RETRY.

  • OO4O_FO_REAUTH indicates that a user handle has been reauthenticated. This applies to the situation where a client has multiple user sessions on a single database connection. During the initial failover, only the active user session is failed over. Other sessions are failed over when the application tries to use them. This is the value passed to the callback during these subsequent failovers.

[in] fo_OraDB The OraDatabase object of the user session that is being failed over. Valid only when the fo_event variant is OO4O_FO_REAUTH.


Failover Notification Example

See Example: Failover Notification.