ORA-02046 Transaction Already Begun, NET
408685Apr 16 2007 — edited Aug 28 2008I am developing a .NET Web application using C# with ODP.NET.
The web application accesses a package created in Oracle 8i. The stored procedures that it contains access data through a dblink to a Oracle 9i database. The first time the web application acceses any of the stored procedures, the searches return data, but the second time I try, I get ORA-02046 (transaction already begun). Each procedure are constructed like the following example:
Procedure sp_SUB_ReciboporPoliza(policynum IN varchar2,sptonum in varchar2,
io_cursor IN OUT t_cursor) as
begin
OPEN io_cursor FOR
select * from SYN_SUB_RECIBOPOLIZA
where
num_poliza = policynum
and num_spto in(sptonum);
commit;
end sp_SUB_ReciboporPoliza;
where io_cursor is a REF_CURSOR in the package and SYN_SUB_RECIBOPOLIZA is a synonim for a query in Oracle 9i. I have search a solution for this and all that I have found is that any query made through a dblink automatically starts a distributed transaction. In the connection string I have added the parameter Enlist=false so it does not start any distributed transactions but it does not work.
I added a COMMIT to the end of each query so it could close the transaction (didn't work either).
I verified that the .NET classes I created for the project, they memory references where released ...but still the problem remains.
If any of you have been in the very same situation or have any suggestions, I will greatly appreciate your help.
Efrain