Subject RE: [Firebird-Java] Re: InputStream Closed
Author Robert DiFalco
>> Since statement closing is quite good idea :),
>> result set will be usually closed earlier.

Yes, but sadly I cache my statements across transactions since I have a
finite number of them and they are so much faster once prepared.

>> No, connection must be open and have an active
>> transaction, result set might be closed.

Great. I'll play with this. As always Roman, thanks for all the help.

-----Original Message-----
From: Roman Rokytskyy [mailto:rrokytskyy@...]
Sent: Friday, June 20, 2003 2:01 PM
To: Firebird-Java@yahoogroups.com
Subject: [Firebird-Java] Re: InputStream Closed


> Cool. I guess if that is the case, if I am careful to always close
> or commit transactions then there is no need for me to explicitly
> close the result set.

Hmmm... Not sure. Result set will not survive commit, but I do not
know if this will release server resources, it should. Anyway,
according to the JDBC spec result set is automatically closed when the
statement is closed. Since statement closing is quite good idea :),
result set will be usually closed earlier.

> >> What you can do, is to fetch the blob field (rs.getBlob), then
close
> >> the result set (here the blob is closed, i.e. all open input
streams
> >> are closed) and only then obtain input stream from the Blob. I
> haven't
> >> tried this, but it should work.
>
> This will reconnect to the database and reengage the blob data?

No, connection must be open and have an active transaction, result set
might be closed. In fact, result set contains only blob ID, all work
with blob is done via separate API. JayBird hides this difference on
JDBC level, but sometimes it might be useful to work with blob directly.

Roman


Yahoo! Groups Sponsor
ADVERTISEMENT




To unsubscribe from this group, send an email to:
Firebird-Java-unsubscribe@yahoogroups.com



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.