I have a global temporary table (on commit delete rows) called "GLOBAL_T" and a stored procedure which takes a SYS_REFCURSOR as an OUTPUT parameter.
So you can think a stored procedure like this:
PROCEDURE test (POT_CURSOR OUT SYS_REFCURSOR)
IS
BEGIN
--TO FILL THE GTT, CALL ANOTHER PROCEDURE
--BTW, FOLLOWING PROCEDURE HAS NO COMMIT
A_SCHEMA_NAME.A_PACKAGE_NAME.ANOTHER_PROCEDURE();
OPEN POT_CURSOR FOR
SELECT STH FROM GLOBAL_T, BUNCH_OF_OTHER_TABLES B
WHERE B.BLABLA = GLOBAL_T.BLABLA
AND B.BUNCH_OF_OTHER_COLUMNS = T.OTHER_COLUMNS;
END;
The problem is when I call the procedure within a pl/sql block it works fine. But when I call the procedure from .NET it gives me ORA-08103: object no longer exists
The calls are exactly the same. Since the business logic behind the procedures are massive, I tried to simplify them.
The problem is gone after I altered my global temporary table. I made a simple change. Instead of using "on commit delete rows" I used "on commit preserve rows"