Re: Autonomous Transaction Sequencing

  • From: Martin Berger <martin.a.berger@xxxxxxxxx>
  • To: Stefan Knecht <knecht.stefan@xxxxxxxxx>
  • Date: Sat, 13 Jan 2018 11:58:03 +0100

Hi Stefan,

can you set in your main block (before you call set_start) something like

DBMS_SESSION.SET_IDENTIFIER(something-unique);
and in every procedure

DBMS_APPLICATION_INFO.SET_ACTION ('set_begin');

and then trace the calls?

I am curious if the negative time is visible there also.

Martin




2018-01-13 9:01 GMT+01:00 Stefan Knecht <knecht.stefan@xxxxxxxxx>:

Hi all

If you have a code structure similar to this:

begin
procedure set_start
is
pragma autonomous_transaction;
begin
update t set start_time=systimestamp;
commit;
end;
procedure set_end
is
pragma autonomous_transaction;
begin
update t set end_time=systimestamp;
commit;
end;
begin
set_start;
-- run some code here that takes anywhere between 0.1 and 2 seconds to
complete
commit;
set_end;
end;
/

I have some executions of this code, 40 out of 6000 runs, where I end up
with the end_time being a timestamp BEFORE the begin_time and not just a
microsecond or two. 0.4 seconds, 0.6 seconds. A significant amount of time.

This leads me to believe that Oracle somehow fires autonomous transactions
asynchronously or out of order of the code structure?

Before I go off on a digging spree - has anyone seen this before or has an
explanation?

Oracle 12.1 on *nix.

Cheers

Stefan




--
//
zztat - The Next-Gen Oracle Performance Monitoring and Reaction Framework!
Visit us at zztat.net | Support our Indiegogo campaign at igg.me/at/zztat
| @zztat_oracle

Other related posts: