[
https://issues.apache.org/jira/browse/DERBY-2730?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12504672
]
Kristian Waagan commented on DERBY-2730:
----------------------------------------
Unless I get wild protests, I will change the following line in the
ClobUpdateableReader constructor as below:
+ maxPos = Math.min(clob.length(), pos + len);
to be simply
maxPos = pos + len;
The reason is that the clob.length() call can be very expensive. At this point,
we might have already exhausted the stream two times. Doing it even once more
is unnecessary in this case:
* First of all the check is already done in
EmbedClob.getCharacterStream(long,long). This must be done to comply with the
JDBC spec.
* Second, even if the former test was removed, ClobUpdateableReader would
behave properly if maxPos turns out to be set to a value larger then the actual
size of the Clob. The underlying stream would simply return -1, which is
exactly what the maxPos variable is used for anyway.
The change will go in with another change in a yet-to-be-created-Jira (I will
create a link to it).
> Implement not implemented Embedded methods Blob.getBinaryStream(long pos,
> long length) and Clob. getCharacterStream(long pos, long length)
> ------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: DERBY-2730
> URL: https://issues.apache.org/jira/browse/DERBY-2730
> Project: Derby
> Issue Type: New Feature
> Components: JDBC
> Affects Versions: 10.3.0.0
> Reporter: V.Narayanan
> Assignee: V.Narayanan
> Fix For: 10.3.0.0
>
> Attachments: GetBinaryStreamImpl_v1.diff,
> GetBinaryStreamImpl_v1.stat, GetBinaryStreamImpl_v1_NOT_FOR_COMMIT.diff,
> GetBinaryStreamImpl_v1_NOT_FOR_COMMIT.stat, GetBinaryStreamImpl_v2.diff,
> GetBinaryStreamImpl_v2.stat, GetCharacterStreamImpl_v1.diff,
> GetCharacterStreamImpl_v1.stat, GetCharacterStreamImpl_v2.diff,
> GetCharacterStreamImpl_v2.stat
>
>
> The following methods were introduced in the java.sql.Clob and java.sql.Blob
> interface as part of JDBC 4.0 and need to be implemented.
> Clob
> ------
> getCharacterStream(long pos, long length)
> Blob
> ------
> getBinaryStream(long pos, long length)
> The implementation on the Network Client is already done as part of Derby-2444
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.