Cursor management
The LN Oracle database driver has a resource variable that influences the cursor handling:
-
retained_cursors
Use this resource to reduce the number of inactive cursors, and therefore the number of open cursors.
After all rows are fetched, the driver has a facility to place inactive cursors, which are cursors in Cancel status, in a cancelled list; this is so the cursors become candidates for assignment to a different query. However, a number of inactive cursors in this list are not available for this, and are defined by the resource retained_cursors.
If the number of cursors in the cancel list exceeds the value of retained_cursors, a request for a new cursor is issued, and no reusable cursors are available, the least recently inactivated cursor is used for this new cursor. This cursor is disassociated from the original query and assigned to a new query, which performs the parsing and binding on this cursor. If the original query carries out a re-execute, the driver detects that the cursor is associated with another query and receives a new cursor and reparse, and then binds the query again.
If you increase the value of retained_cursors, this can lead to less reparsing and rebinding of queries, which reduces CPU resources. However, the result is that the number of open cursors and memory increases.