ORA-02074: cannot SET SAVEPOINT in a distributed transaction
I've developed a very simple stored procedure that writes in two database tables and depending on internal result, can rollback or commit the transaction.
The procedure works fine as the desired user from sql script Toad but when it is called from a web page the error returned is Insert User ORA-02074: cannot SET SAVEPOINT in a distributed transaction Code-2074.
I've read that to get around this problem i have to declare the stored procedure as pragma autonomous_transaction but it doesn't work well.
The client code uses the Enterprise Library for .NET Framework 2.0. The Oracle database is 18.104.22.168.
The S.P. code is like this:
create or replace procedure insert_into_t
myCondition boolean ;
insert into t values ( 1 );
if myCondition then
rollback to A;
Thanks - Davide.