You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Tomohito Nakayama (JIRA)" <de...@db.apache.org> on 2005/12/23 06:33:33 UTC

[jira] Updated: (DERBY-782) Improvement on org.apache.derby.impl.jdbc.EmbedBlob#length()

     [ http://issues.apache.org/jira/browse/DERBY-782?page=all ]

Tomohito Nakayama updated DERBY-782:
------------------------------------

    Attachment: testLob4.java

Current implementation of org.apache.derby.impl.jdbc.EmbedBlob#length() have some problematic behavior.
If length() method was called when InputStream was being read, the InputStream was finished.

Attached testLob4.java shows this behavior.

naka@rufelza:~/derby/test/20051223$ java testLob4
Here goes 1st stream
0
1
2
length:1048576
Here continue 1st stream
-1
-1
-1

I found next description in javadoc comment in org.apache.derby.impl.jdbc.EmbedBlob.
   This means that we have limited control over the state of the stream, since the user can read bytes from it at any time. 
   Thus all methods here reset the stream to the beginning before doing any work


This problematic behavior may be resolved spontaneously in this issue.


> Improvement on org.apache.derby.impl.jdbc.EmbedBlob#length()
> ------------------------------------------------------------
>
>          Key: DERBY-782
>          URL: http://issues.apache.org/jira/browse/DERBY-782
>      Project: Derby
>         Type: Bug
>   Components: JDBC
>     Reporter: Tomohito Nakayama
>  Attachments: testLob4.java
>
> Now, org.apache.derby.impl.jdbc.EmbedBlob#length() method read out whole  BinaryToRawStream to know exact length.
> On the other hand,  BinaryToRawStream have some commented-out inplementation of having information for length.
> I think the information of lengh in BinaryToRawStream should be restored to be used in .org.apache.derby.impl.jdbc.EmbedBlob#length(), because read out whole stream can be expensive processing when streamed information was large.
> There exists a subject that reliability of lengh information in BinaryToRawStream is unknown.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira