Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions source/core/types/ut_suite_item.tpb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ create or replace type body ut_suite_item as
begin
if get_rollback_type() = ut_utils.gc_rollback_auto then
l_savepoint := ut_utils.gen_savepoint_name();
dbms_transaction.savepoint(l_savepoint);
execute immediate 'savepoint ' || l_savepoint;
end if;
return l_savepoint;
end;
Expand All @@ -65,7 +65,7 @@ create or replace type body ut_suite_item as
pragma exception_init(ex_savepoint_not_exists, -1086);
begin
if get_rollback_type() = ut_utils.gc_rollback_auto and a_savepoint is not null then
dbms_transaction.rollback_savepoint( a_savepoint );
execute immediate 'rollback to ' || a_savepoint;
end if;
exception
when ex_savepoint_not_exists then
Expand Down
15 changes: 15 additions & 0 deletions source/core/ut_savepoint_seq.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
create sequence ut_savepoint_seq
/*
utPLSQL - Version 3
Copyright 2016 - 2018 utPLSQL Project
Licensed under the Apache License, Version 2.0 (the "License"):
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
start with 1 cache 20;
2 changes: 1 addition & 1 deletion source/core/ut_utils.pkb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ create or replace package body ut_utils is

function gen_savepoint_name return varchar2 is
begin
return '"'|| utl_raw.cast_to_varchar2(utl_encode.base64_encode(sys_guid()))||'"';
return 's'||trim(to_char(ut_savepoint_seq.nextval,'0000000000000000000000000000'));
end;

procedure debug_log(a_message varchar2) is
Expand Down
1 change: 1 addition & 0 deletions source/install.sql
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ alter session set current_schema = &&ut3_owner;
@@install_component.sql 'core/types/ut_reporters_info.tps'
@@install_component.sql 'core/ut_utils.pks'
@@install_component.sql 'core/ut_metadata.pks'
@@install_component.sql 'core/ut_savepoint_seq.sql'
@@install_component.sql 'core/ut_utils.pkb'
@@install_component.sql 'core/ut_metadata.pkb'
@@install_component.sql 'reporters/ut_ansiconsole_helper.pks'
Expand Down
2 changes: 2 additions & 0 deletions source/uninstall_objects.sql
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ drop package ut_ansiconsole_helper;

drop package ut_utils;

drop sequence ut_savepoint_seq;

drop type ut_documentation_reporter force;

drop type ut_teamcity_reporter force;
Expand Down
4 changes: 2 additions & 2 deletions test/api/test_ut_run.pkb
Original file line number Diff line number Diff line change
Expand Up @@ -808,9 +808,9 @@ Failures:%
procedure drop_test_suite is
pragma autonomous_transaction;
begin
drop_db_link;
execute immediate 'drop package stateful_package';
execute immediate 'drop package test_stateful';
drop_db_link;
end;

procedure run_in_invalid_state is
Expand Down Expand Up @@ -1007,9 +1007,9 @@ Failures:%
procedure drop_suite_with_link is
pragma autonomous_transaction;
begin
drop_db_link;
execute immediate 'drop table tst';
execute immediate 'drop package test_distributed_savepoint';
drop_db_link;
end;

end;
Expand Down