downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

OCI-Collection->append> <oci_cancel
Last updated: Fri, 13 Nov 2009

view this page in

oci_close

(PHP 5, PECL OCI8 >= 1.1.0)

oci_closeOracleとの接続を閉じる

説明

bool oci_close ( resource $connection )

Oracle との接続 connection を閉じます。

パラメータ

connection

Oracle 接続 ID。 oci_connect() によって返される。

返り値

成功した場合に TRUE を、失敗した場合に FALSE を返します。

注意

注意: バージョン 1.1 から oci_close() は正確に Oracle 接続を閉じます。この関数の古い動作をさせる場合は oci8.old_oci_close_semantics オプションを使用してください。



add a note add a note User Contributed Notes
oci_close
yepster at hotmail dot com
16-Feb-2002 06:21
For using persistent connections && being able to sleep, I use:

function close_db_locks_on_abort( ) {
    global $conn;
    if( connection_aborted() ) {
        $fp = fopen( "/tmp/shutdown-func.txt", "a" );
        fwrite( $fp, sprintf( "connection aborted on %s\n", date( "d-m-Y H:i:s" ) ) );
        if( $conn ) {
            OCIRollBack( $conn );
            fwrite( $fp, sprintf( "-- DURING CONNECTION! ip=%s, user=%s, page=%s\n", $_SERVER["REMOTE_ADDR"], $_SERVER["PHP_AUTH_USER"], $_SERVER["SCRIPT_FILENAME"] ) );
        }
        fclose( $fp );
    }
}

register_shutdown_function ( "close_db_locks_on_abort" );

This makes sure a rollback is done on a connection when a user hits 'stop', so there will be no locks on table rows.

OCI-Collection->append> <oci_cancel
Last updated: Fri, 13 Nov 2009
 
 
show source | credits | sitemap | contact | advertising | mirror sites