Enable and disable a callback

A callback must be enabled for the database server to invoke it. The mi_register_callback() function automatically enables the callback that it registers. You can explicitly disable a registered callback with the mi_disable_callback() function. When you disable a callback, you suspend its invocation. You can later explicitly re-enable it with the mi_enable_callback() function.

Tip: If you want to reuse a callback, it is usually less resource intensive to disable and re-enable the callback than to unregister and reregister it.
Both the mi_enable_callback() and mi_disable_callback() functions take the following arguments:
  • A connection descriptor.

    The connection descriptor must have the same value that the mi_register_callback() statement used when it registered the callback. For more information, see Connection descriptor.

  • An MI_EVENT_TYPE value.

    This argument identifies the event type that the callback handles. For more information, see DataBlade API event types.

  • A callback handle for a registered callback.

    The mi_register_callback() function returns a callback handle when it successfully registers a callback. This handle identifies the callback to the mi_enable_callback() or mi_disable_callback() function. For more information, see Callback handle.