<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.oci8.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'ja',
  ),
  'this' => 
  array (
    0 => 'function.oci-register-taf-callback.php',
    1 => 'oci_register_taf_callback',
    2 => 'Register a user-defined callback function for Oracle Database TAF',
  ),
  'up' => 
  array (
    0 => 'ref.oci8.php',
    1 => 'OCI8 関数',
  ),
  'prev' => 
  array (
    0 => 'function.oci-pconnect.php',
    1 => 'oci_pconnect',
  ),
  'next' => 
  array (
    0 => 'function.oci-result.php',
    1 => 'oci_result',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/oci8/functions/oci-register-taf-callback.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.oci-register-taf-callback" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">oci_register_taf_callback</h1>
  <p class="verinfo">(PHP 7.0 &gt;= 7.0.21, PHP 8, PHP 7 &gt;= 7.1.7, PHP 8, PECL OCI8 &gt;= 2.1.7)</p><p class="refpurpose"><span class="refname">oci_register_taf_callback</span> &mdash; <span class="dc-title">Register a user-defined callback function for Oracle Database TAF</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.oci-register-taf-callback-description">
  <h3 class="title">説明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>oci_register_taf_callback</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> <code class="parameter">$connection</code></span>, <span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.callable.php" class="type callable">callable</a></span></span> <code class="parameter">$callback</code></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   Registers a user-defined callback function to <code class="parameter">connection</code>.
   If <code class="parameter">connection</code> fails due to instance or network failure,
   the registered callback function will be invoked for several times during
   failover. See <a href="oci8.taf.php" class="link">OCI8 Transparent Application Failover
   (TAF) Support</a> for information.
  </p>
  <p class="para">
   When <span class="function"><strong>oci_register_taf_callback()</strong></span> is called multiple times,
   each registration overwrites the previous one.
  </p>
  <p class="para">
   Use <span class="function"><a href="function.oci-unregister-taf-callback.php" class="function">oci_unregister_taf_callback()</a></span> to explicitly unregister a
   user-defined callback.
  </p>
  <p class="para">
   TAF callback registration will NOT be saved across
   persistent connections, therefore the callback needs to be re-registered for
   a new persistent connection. 
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.oci-register-taf-callback-parameters">
  <h3 class="title">パラメータ</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">connection</code></dt>
     <dd>
      <p class="para">
       An Oracle connection identifier.
      </p>
     </dd>
    
    
     <dt><code class="parameter">callback</code></dt>
     <dd>
      <p class="para">
       A user-defined callback to register for Oracle TAF. It can be a
       string of the function name or a Closure (anonymous function).
      </p>
      <p class="para">
       The interface of a TAF user-defined callback function is as follows:
      </p>
      <div class="methodsynopsis dc-description">
       <span class="methodname"><strong>userCallbackFn</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> <code class="parameter">$connection</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$event</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$type</code></span>): <span class="type"><a href="language.types.integer.php" class="type int">int</a></span></div>

      <p class="para">
       See the parameter description and an example on <a href="oci8.taf.php" class="link">
       OCI8 Transparent Application Failover (TAF) Support</a> page.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.oci-register-taf-callback-returnvalues">
  <h3 class="title">戻り値</h3>
  <p class="para">
   成功した場合に <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> を、失敗した場合に <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> を返します。
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.oci-register-taf-callback-seealso">
  <h3 class="title">参考</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.oci-unregister-taf-callback.php" class="function" rel="rdfs-seeAlso">oci_unregister_taf_callback()</a> - Unregister a user-defined callback function for Oracle Database TAF</span></li>
   </ul>
  </p>
 </div>


</div><?php manual_footer($setup); ?>