Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Newbie needs help with "Object has been closed" exception  RSS feed

Doug Slattery
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aloha ranchers,

I'm starting to work with JDBC and MSSQL this week. This thread is related to this thread for those who are wondering...

With help from a co-worker, I have successfully setup a JNDI datasource in Tomcat. I've also been able to connect to the server and run a simple stored procedure. After turning up the heat a bit, I've ran into a problem and have searched for an answer, which has lead me here.

The Problem:
I'm trying to set up a simple stored procedure that will return a result set (empty is ok for now) of dummy values without accessing any tables. What I have seems to fly with SQL, but on the Java side, the result set is being closed somewhere.

Here's the SP:

And here's the Java code:

The last Java line (logger.debug...) shows "returnCode [00000] Query Timeout: [10]" as expected. However, if I inspect resultSet at that line (using the Sysdeo debugger), it shows the _res->closed property as true. Thus, when I get to the set iterator, an "Object has been closed" exception is thrown. I have been quick enough on the draw at times to see the _res->closed property set to false, but it never makes it to the iterator. Even with no break points set. I suspect there is a setting somewhere, perhaps a poolable(?) one that I don't know where to look for. Anyone have any ideas?


-- Nothing is impossible if I'mPossible
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!