v_num_day numeric; v_batch_count numeric; v_log_count numeric := 0; v_local_batch_count numeric; BEGIN v_batch_count := 0; LOOP BEGIN
This isn't what I suggested. How are you connecting to the database to call your TEST_TRANSACTION function? Some clients will issue BEGIN silently to allow rollback. If you have a BEGIN that is called before the function starts, then the function cannot call commit. The function must be called while NOT in a transaction already.