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

Skip to content

Commit 8a90ef8

Browse files
committed
Changed solution for savepoints on distributed transactions.
Solution with DBMS_SESSION was causing instability on 18c (hanging builds).
1 parent 752fccb commit 8a90ef8

3 files changed

Lines changed: 3 additions & 4 deletions

File tree

source/core/types/ut_suite_item.tpb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ create or replace type body ut_suite_item as
5454
begin
5555
if get_rollback_type() = ut_utils.gc_rollback_auto then
5656
l_savepoint := ut_utils.gen_savepoint_name();
57-
dbms_transaction.savepoint(l_savepoint);
57+
execute immediate 'savepoint ' || l_savepoint;
5858
end if;
5959
return l_savepoint;
6060
end;
@@ -65,7 +65,7 @@ create or replace type body ut_suite_item as
6565
pragma exception_init(ex_savepoint_not_exists, -1086);
6666
begin
6767
if get_rollback_type() = ut_utils.gc_rollback_auto and a_savepoint is not null then
68-
dbms_transaction.rollback_savepoint( a_savepoint );
68+
execute immediate 'rollback to ' || a_savepoint;
6969
end if;
7070
exception
7171
when ex_savepoint_not_exists then

source/core/ut_utils.pkb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ create or replace package body ut_utils is
5252

5353
function gen_savepoint_name return varchar2 is
5454
begin
55-
return '"'|| utl_raw.cast_to_varchar2(utl_encode.base64_encode(sys_guid()))||'"';
55+
return 's'||to_char(current_timestamp,'yyyymmddhh24missff6');
5656
end;
5757

5858
procedure debug_log(a_message varchar2) is

test/api/test_ut_run.pks

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ create or replace package test_ut_run is
5656
--%aftertest(drop_failing_beforeall_suite)
5757
procedure run_proc_fail_child_suites;
5858

59-
--%disabled(Checking if disabling the test will help hanging Travis build)
6059
--%test(Savepoints are working properly on distributed transactions - Issue #839)
6160
--%beforetest(create_suite_with_link)
6261
--%aftertest(drop_suite_with_link)

0 commit comments

Comments
 (0)