When the first insert, update, or delete operation on a spatial table (one with a spatial index) is performed in a distributed transaction, all subsequent insert, update, or delete operations on the table, as well as any prepare to commit operation (the first branch to prepare a commit), in the transaction should happen in the same session as the first operation.
Since I'm doing autonomous transactions, I'm wondering if they happen in the same session or if a separate one is opened for them.
Thanks for your help
A session can have multiple transactions, so this is all done within a single session.
SQL> create table t ( n number);
Table created.
SQL>
SQL> create or replace
2 procedure p1 is
3 pragma autonomous_transaction;
4 begin
5 insert into t values ( sys_context('userenv','sid'));
6 commit;
7 end;
8 /
Procedure created.
SQL> create or replace
2 procedure p2 is
3 pragma autonomous_transaction;
4 begin
5 insert into t values ( sys_context('userenv','sid'));
6 commit;
7 p1;
8 end;
9 /
Procedure created.
SQL> create or replace
2 procedure p3 is
3 pragma autonomous_transaction;
4 begin
5 insert into t values ( sys_context('userenv','sid'));
6 commit;
7 p2;
8 end;
9 /
Procedure created.
SQL>
SQL> exec p3;
PL/SQL procedure successfully completed.
SQL> select * from t;
N
----------
982
982
982