note 38927 added to ref.oracle

From: Date: Mon, 12 Jan 2004 15:21:19 +0000
Subject: note 38927 added to ref.oracle
Groups: php.notes 
Request: Send a blank email to php-notes+get-63352@lists.php.net to get a copy of this message
To make sure my oracle get's rolledback when my script once in a while dies or I make a mistake (statements are terminated with ";"...). I use this construction. Because if it isn't rolled back and you use plogon, other oracle connections might hang, until the apache process that ran the failed script is terminated, and therefore releases the connection and gives the implicit rollback. The use of a shutdown_function: $oracle = ora_plogon("user/pass@db", "") or die("Can't connect to db"); $cursor = ora_open($oracle); ora_commitoff($oracle); function ora_shutdown() { global $oracle; global $cursor; ora_rollback($oracle); ora_close($cursor); ora_logoff($oracle); } register_shutdown_function(ora_shutdown); ---- Manual Page -- http://www.php.net/manual/en/ref.oracle.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+38927 Delete -- http://master.php.net/manage/user-notes.php?action=delete+38927&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+38927&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#63352) next »