Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle JDBC driver exception "Stream has already been closed"

Re: Oracle JDBC driver exception "Stream has already been closed"

From: Anton Nemychenkov <antonn_at_yahoo.com>
Date: 17 Mar 2004 11:22:40 -0800
Message-ID: <e4a11fbb.0403171122.70e7de63@posting.google.com>


Thomas Kellerer wrote:
> On 17.03.2004 01:42 Anton Nemychenkov wrote:
>
> > Hello,
> >
> > We get this exception when trying to read data from column of type
> > LONG (using OracleResultSet.getCharacterStream()). I've searched
> > newsgroups and read Oracle documentation on the subject. We seem to
> > do everything according to the doc: the order of columns is correct
> > (we read values from ResultSet in the same order as they appear in
> > select list) and we try to access the stream right after it was
> > fetched (prefetch size is explicitly set to 1). Does anyone know what
> > else might be wrong?
> >
> > Thank you in advance.
> >
> > Anton.
>
> Hello,
>
> I have encountered this problem, when I executed another statement on the same
> connection while the initial result set/statement was not yet closed. In my case
> it was roughly the following sequence:
>
> statement1 = connection.createStatement();
> result1 = statement1.executeQuery(...);
>
> statement2 = connection.createStatement();
> result2 = statement2.executeQuery(...)
>
> Now, when you process result1 you'll get the error message when trying to read a
> LONG column (in my case I was using getObject() and not getCharacterStream())
>
> Maybe you are doing something similar.
>
>
> Regards
> Thomas

Thomas, this was also the case in our code: we executed several more statements using the same connection before accessing the result set containing streams. Now that we access it immediately after execution it works fine.

Thank you very much for your help!

Anton. Received on Wed Mar 17 2004 - 13:22:40 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US