PHP Function Oci_Close
Articles
php function oci_close() unsets the Oracle connection identifier used by a session. This ensures that the underlying database connection is properly terminated and that the database resources are released. It is important to close connections that are no longer needed because this makes the connection available for reuse and reduces resource contention.
oci_close() can be called for individual persistent connection handles or in conjunction with oci_pconnect() to manage multiple connections in a pool. It is recommended that you use oci_pconnect() when possible because it provides better performance and simplifies configuration of your application.
For example, using oci_pconnect() for a session that has been inactive for a long time will help reduce the number of open connections in the pool, which in turn increases the overall performance of the web server.
In some cases, oci_close() may not properly close the underlying database connections that were created with oci_connect() and can lead to memory leaks. For this reason, it is important that you also use oci_close() and oci_free_statement() to correctly close and free the connection resources associated with the statement.
For statements that execute a query, oci_bind_by_name() binds the SQL statement parameter to a PHP variable. This allows you to re-execute the query with different values for the parameter and experiment with different results without having to change the SQL statement. You can also optimize performance by binding an array var_array to the query and then calling oci_fetch_array() with different prefetch sizes. This provides internal row buffering, which can reduce the number of physical database accesses to return all the data to PHP.