By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,514 Members | 1,702 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,514 IT Pros & Developers. It's quick & easy.

result set is closed

P: n/a
Hi all,

I'm having a problem with the type 4 JDBC driver over DB2 v8.1 on
Linux. We've recently begun to use Blobs to store documents in our
table structure. Problem is: we're able to retrieve some (but not all)
such documents by invoking ResultSet.getBinaryStream() or, alternately,
ResultSet.getBlob() followed by Blob.getBinaryStream().

For some (as yet undetermined) reason, attempting to retrieve some
documents using either of the aforementioned methods fails with
"Invalid operation: result set is closed" even before we've tried to
iterate over the result set with next(). Has anyone encountered a
similar problem? If so, how did you work around it?

Thanks in advance!

Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
skykeys wrote:
Hi all,

I'm having a problem with the type 4 JDBC driver over DB2 v8.1 on
Linux. We've recently begun to use Blobs to store documents in our
table structure. Problem is: we're able to retrieve some (but not all)
such documents by invoking ResultSet.getBinaryStream() or, alternately,
ResultSet.getBlob() followed by Blob.getBinaryStream().

For some (as yet undetermined) reason, attempting to retrieve some
documents using either of the aforementioned methods fails with
"Invalid operation: result set is closed" even before we've tried to
iterate over the result set with next(). Has anyone encountered a
similar problem? If so, how did you work around it?


Do you have auto-commit turned off?

I would think that BLOBs are retrieved in chunks by JDBC/CLI, and that in
between the retrieval of the chunks an implicit commit is run.

--
Knut Stolze
Information Integration Development
IBM Germany / University of Jena
Nov 12 '05 #2

P: n/a
Knut Stolze wrote:
skykeys wrote:
Hi all,

I'm having a problem with the type 4 JDBC driver over DB2 v8.1 on
Linux. We've recently begun to use Blobs to store documents in our
table structure. Problem is: we're able to retrieve some (but not all)
such documents by invoking ResultSet.getBinaryStream() or, alternately,
ResultSet.getBlob() followed by Blob.getBinaryStream().

For some (as yet undetermined) reason, attempting to retrieve some
documents using either of the aforementioned methods fails with
"Invalid operation: result set is closed" even before we've tried to
iterate over the result set with next(). Has anyone encountered a
similar problem? If so, how did you work around it?
Do you have auto-commit turned off?


No, I did not. But I will try it now.
I would think that BLOBs are retrieved in chunks by JDBC/CLI, and that in
between the retrieval of the chunks an implicit commit is run.

Yes, this makes sense to me too. I'll keep you posted. Thanks for the
reply.
--
Knut Stolze
Information Integration Development
IBM Germany / University of Jena


Nov 12 '05 #3

P: n/a
Thanks, Knut. After setting Connection.autoCommit(false), the
exception has gone away but (I believe) the result set is still closed
since ResultSet.next() returns "false" for the offending rows. If it
helps, I'm using the type 4 driver (db2jcc.jar and
db2jcc_license_cu.jar) in Tomcat.

Perhaps this is a character set issue? Hmmm. I've got one more thing
to try...hold on.

No, this is not a character set issue. In trying to isolate the
problem, I've written a small command line program to load the driver,
instantiate a connection, and select Blob content from the offending
columns and it works!

However, the same code executed in a servlet container yields closed
result sets. Perhaps this is a threading or security manager issue?
Until now, I thought DB2 Connection objects were threadsafe. Usually,
I instantiate one connection per servlet context and bind it to each
session in an HttpSessionListener. I may have to rethink this
approach.

If this is a security manager issue, then I'll have to devise a test
for that. I'll continue to investigate and keep you posted.

Thanks again!

Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.