db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kathey Marsden <kmarsdende...@sbcglobal.net>
Subject Re: DERBY-255 Closing a resultset after retrieving a large > 32K alue with Network Server does not release locks
Date Sat, 28 May 2005 21:40:46 GMT
Kathey Marsden wrote:

On how to get stream length of the ResultSet.getBinaryStream().  I
talked about two options.

>    1)  I have a fix in a maintenance branch of an old Cloudscape
>release which I could port.  This does getString() or getBytes() to get
>the value and then has the associated length.
>    2)  I'd actually have to call getBinaryStream twice, once to get the
>length (with available(), skip()) and again to stream
>          the data to the client.  Maybe this is not so bad since
>Blob.length()  does something similar for large values, but actually
>reads the data,  So I suppose for large values this might be faster than
>what we do now.
>
>  
>

Option #2 just doesn't seem to work because I cannot figure out how to
reset the input stream.  A second call to
rs.getBinaryStream() gives me:
SQLState:   XJ001
Severity: 0
Message:  Java exception: ': java.io.EOFException'.
java.io.EOFException
        at
org.apache.derby.impl.jdbc.BinaryToRawStream.<init>(BinaryToRawStream.java:53)
        at
org.apache.derby.impl.jdbc.EmbedResultSet.getBinaryStream(EmbedResultSet.java:1160)
        at derby255.LargeDataLocks.testBinaryData(LargeDataLocks.java:84)
        at derby255.LargeDataLocks.testLocks(LargeDataLocks.java:58)
        at derby255.LargeDataLocks.main(LargeDataLocks.java:39)

mark/reset is not supported.  I am leaning toward option 1, but wanted
to give one last appeal before I go that route.
Any ideas on how to reset the input stream after getting  the length?

Kathey



Mime
View raw message