Uh oh!
There was an error while loading. Please reload this page.
Don't leave cursors open - #23993
Conversation
nickvergessen
commented
Nov 9, 2020
/backport to stable20 |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Signed-off-by: Joas Schilling <coding@schilljs.com>
c59ae47 to
8027dcbCompareicewind1991
commented
Nov 9, 2020
closing the cursor before a return makes no functional difference and only clutters the code, the cursor will be closed automatically when the result goes out of scope. it only makes sense to manually close cursors if there is significant work being done in a function after the results are fetched |
MorrisJobke
commented
Nov 9, 2020
Was about to ask this as well. It looks really odd that we need to actively close the cursor there. Does this really fix the OCI cursor leak? |
nickvergessen
commented
Nov 10, 2020
Well at least the OC_DB methods leave cursors behind I don't know why and how, maybe because of the static-ness. |
nickvergessen
commented
Nov 10, 2020
And then I think it doesn't hurt and we should just make it a pattern in our code base. So when someone adds a second query or some code after your query they dont need to magically remember to add a closeCursor for the query above |
Signed-off-by: Joas Schilling coding@schilljs.com