略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: oci_register_taf_callback

2024-11-13

oci_register_taf_callback

(PHP 7.0 >= 7.0.21, PHP 8, PHP 7 >= 7.1.7, PHP 8, PECL OCI8 >= 2.1.7)

oci_register_taf_callbackRegister a user-defined callback function for Oracle Database TAF

说明

oci_register_taf_callback(resource $connection, ?callable $callback): bool

Registers a user-defined callback function to connection. If connection fails due to instance or network failure, the registered callback function will be invoked for several times during failover. See OCI8 Transparent Application Failover (TAF) Support for information.

When oci_register_taf_callback() is called multiple times, each registration overwrites the previous one.

Use oci_unregister_taf_callback() to explicitly unregister a user-defined callback.

TAF callback registration will NOT be saved across persistent connections, therefore the callback needs to be re-registered for a new persistent connection.

参数

connection

An Oracle connection identifier.

callback

A user-defined callback to register for Oracle TAF. It can be a string of the function name or a Closure (anonymous function).

The interface of a TAF user-defined callback function is as follows:

userCallbackFn(resource $connection, int $event, int $type): int

See the parameter description and an example on OCI8 Transparent Application Failover (TAF) Support page.

返回值

成功时返回 true, 或者在失败时返回 false

参见

add a noteadd a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/function.oci-register-taf-callback.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3