I am using Matlab 2018a to connect to an Oracle DB via JDBC. oracle version is 11.2.
My program is an "engine" that activates a series of user written funcions.
If the number of functions is large I might get an "ORA-01000 maximum open cursors exceeded" error.
currently I'm handling this issue by closing and opening the DB connection but this is a big setback for performance.
What I thought of doing is to get the cursers table before and after the function and just closing the cursors that were opened by the function I ran.
So I extracted the V$SESSION and V$OPEN_CURSORS tables and was suprised to find a bunch of open cursers from my session.
I'm not explicitly opening cursors and also the functions I run does not open cursors explicitly but we are using function that execute SQL queries.
So:
- How do I know which cursors were opened by the function I ran? Does cursors have unique IDs that I should use to discriminate them?
- Should I only look at the open cursors or should I also be worried about closed cursors? Can they suddenly become open cursors?
Thanks!