We are using Jasper reports with java for one of our reporting application and use 'SELECT' queries to fetch data and generate reports using Jasper reporting templates. They are a bunch of old queries, some are not tuned, their performance depends on the parameters they take. Ex-date ranges, categories, etc.
Lately, we have been experiencing weird cursor issues, the count of cursors the app is holding is going high, up to 900 at times, this is causing some serious space issues. We are manually closing them to temporarily overcome this issue. However, the issue is coming back again and again and has been a serious concern.
My understanding of the 'SELECT' statements is that they will implicitly use the CURSOR methodology, but make sure that once the operations are complete, they are closed. And we don't have much control from the application side.
Debugging / Troubleshooting the issue:
We ran the query though DBA and see no issues, again it's just a regular SELECT query and we are not explicitly creating any cursor.
Changed the DB calls to a read-only state, didn't work.
Looks like Jasper server uses regular JDBC prepared statements - ODBC driver - ojdbc14.
No pagination used.
Question :
We are out of leads on this issue, if someone can help us with this it would be great.
Edit
SID =4385 has the following sql with count of open cursor
SQL_ID COUNT(*)
sql_id = 9q3btvwzg96k6 keeps opening the new cursors.
The local static cursors are closed for you.
you can see the max open cursors parameter as below:
show parameter open_cursor
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
open_cursors integer 300
Cursors opened within the inner block have obviously not been implicitly closed. Had they been closed, I would not have exceeded the maximum number of open cursors.
If cursor is already opened then Do Not close it , just use it.
In any case the quickest fix would be to
alter system set open_cursors = 1000 scope=both;
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.