/**
* Disconnects from the Oracle Matrix DB
*
* @return void
* @access private
*/
function _disconnectFromMatrixDatabase()
{
    $conn_id = MatrixDAL::getCurrentDbId();
    if (isset($conn_id) && !empty($conn_id)) {
        MatrixDAL::restoreDb();
        MatrixDAL::dbClose($conn_id);
    }
    //end if
}
/**
* Disconnects from the Oracle Matrix DB
*
* @return void
* @access private
*/
function _disconnectFromMatrixDatabase()
{
    while (TRUE) {
        try {
            $conn_id = MatrixDAL::getCurrentDbId();
        } catch (Exception $e) {
            // run out of connections, that's it
            break;
        }
        MatrixDAL::restoreDb();
        MatrixDAL::dbClose($conn_id);
    }
}
        $sql = 'CREATE SEQUENCE sq_' . $sequence . '_seq START WITH ' . $new_seq_start;
        $ok = MatrixDAL::executeSql($sql);
        if ($ok === false) {
            printUpdateStatus('Failure, unable to run query: ' . $sql);
            exit;
        }
        printUpdateStatus('OK');
    }
    $first_run = false;
}
/**
 * Lastly, close all the db connections.
 */
MatrixDAL::restoreDb();
MatrixDAL::dbClose($dest_db);
MatrixDAL::dbClose($source_db);
pre_echo('Conversion is complete');
echo "\n";
$rebakeCmd = "/usr/bin/php {$SYSTEM_ROOT}/scripts/rebake.php {$SYSTEM_ROOT}";
echo "rebake.php now needs to run. Do this now [Y/n] ? ";
$response = strtolower(trim(fgets(STDIN)));
if (empty($response) === TRUE) {
    $response = 'y';
}
if ($response != 'y') {
    pre_echo("You will need to run {$rebakeCmd} manually.\n");
    exit;
}
echo "Running rebake.php now .. \n";
$output = array();
$rc = -1;