Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Open Cursors:New Issue

 
Bob Mathews
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all Ranchers
I m facing a very peculiar problem in my application

We take connection object fro the connection pool
Do the processings::
Open resultSet
Fire queries
But the resultset is kept open
AND WE HAVE RETURNED THE CONNECTION TO THE POOL
Now the problem is that it ius not possible for us to pit rs.close()
Secondly there are Cursors that are opened automatically with the resultset and as the resultset is not closed they remain open
And thus the cursor remain open and become dangling
So do we have a way to close the dangling cursor created by the system

Please reply fast its urgent
[ October 16, 2006: Message edited by: Bear Bibeault ]
 
Scott Selikoff
author
Saloon Keeper
Posts: 4020
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Odd... very... why can't you use rs.close()? Can you end transactions? Can you force connections to be closed?

Maybe if you gave us more information about your database server, web server, and why you have open cursors.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34837
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Nishant Tiwari:
Now the problem is that it ius not possible for us to pit rs.close()

Why not? Can you show the code to illustrate why it is not possible. I'm having trouble visualizing any case where a finally block wouldn't work.
 
Bob Mathews
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See this is a production issue and the people who have developed it have not put that rs.close
Now if we start placing rs.close people are estimating it will take weeks to put it inplace and test it

I know situation and condition seemed awkward but please help it out

Just think of some alternative solution of closing the open cursor without rs.close


Thanks
It will be of great help
 
Scott Selikoff
author
Saloon Keeper
Posts: 4020
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aside from periodically restarting the application, its hard to make up for bad coding with a hack.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34837
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nishant,
As this is coding issue, it is hard to fix without a coding solution. I can't think of any way to "magically" close the cursors apart from restarting the application.

On a side note, it shouldn't take weeks for an emergency production fix. Maybe you can do a compare to show them only the rs.close() has changed?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic