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, 14 Aug 2009

view this page in

oci_close

(PHP 5, PECL oci8 >= 1.1.0)

oci_closeFerme une connexion Oracle

Description

bool oci_close ( resource $connection )

Ferme une connexion connection Oracle.

Liste de paramètres

connection

Un identifiant de connexion Oracle, retourné par la fonction oci_connect().

Valeurs de retour

Cette fonction retourne TRUE en cas de succès, FALSE en cas d'échec.

Notes

Note: Depuis la version 1.1, oci_close() ferme correctement les connexions Oracle. Utilisez l'option oci8.old_oci_close_semantics pour restaurer l'ancien comportement de cette fonction.



OCI-Collection->append> <oci_cancel
Last updated: Fri, 14 Aug 2009
 
add a note add a note User Contributed Notes
oci_close
ajitsingh4u at gmail dot com
29-Mar-2009 10:31
The PHP engine automatically closes the database connection at the end of the script
unless a persistent connection was made. If you want to explicitly close a database
connection, you can call the oci_close() OCI function with the connection
identifier returned by the oci_connect() call. For example:
<?php
$conn
= oci_connect('hr', 'hr', '//localhost/XE');
...
oci_close($conn);
...
?>
john at petbrain dot com
11-Sep-2002 04:47
OCILogon ... one thing about is, is that its good practice to use OCILogoff, becase you don't really know what the idle release time is from the Oracle server. In my case, the DBM set the idle time insanely high because we have other projects coming out of Oracle and not just php. Just because php exits, doesn't mean the Oracle connection is dead.
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, 14 Aug 2009
 
 
show source | credits | sitemap | contact | advertising | mirror sites