Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / June 2005

Tip: Looking for answers? Try searching our database.

result set is closed

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
skykeys - 29 Jun 2005 00:25 GMT
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!
Knut Stolze - 29 Jun 2005 16:32 GMT
> Hi all,
>
[quoted text clipped - 9 lines]
> 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.

Signature

Knut Stolze
Information Integration Development
IBM Germany / University of Jena

skykeys - 29 Jun 2005 21:12 GMT
> > Hi all,
> >
[quoted text clipped - 11 lines]
>
> 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
skykeys - 29 Jun 2005 21:48 GMT
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!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.