Pro*C calling the wrong instance of a stored after change of current_schema 10.2.0.3 - why and how t
I have a Pro*C program which decides at run time which schema's tables and procedures it should use. Once it has decided, it issues an "ALTER SESSION SET CURRENT_SCHEMA=xxxx" statement to change to the appropriate schema. It then calls C functions compiled in different files that issue queries and anonymous PL/SQL such as "begin :db_return := insert_order (:new_order_no);end;"
I am finding that sometimes the wrong schema's copy of the stored function is being called - the function raises an error because it can't find the right data and the ora-6502 traceback shows the wrong schema. The immediately following function call (again compiled in its own source file) is usually calling the right schema's function, but failing because the first call failed.