db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "V.Narayanan (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-2017) Client driver can insert and commit partial data when a LOB stream throws IOException or does not match the specified length
Date Mon, 04 Jun 2007 09:26:36 GMT

    [ https://issues.apache.org/jira/browse/DERBY-2017?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12501161
] 

V.Narayanan commented on DERBY-2017:
------------------------------------

I have a few questions, pls feel free to ignore them if you think they are unrelated.

1) By "The stream is read (like in embedded mode) to validate the length" is it meant that
the
    Stream should be materialized completely  in tempChars (the array used in the patch 
    attached)? 
   
    If this is true wouldn't it result in OutOfMemory problems when the stream is too large?

2) The logic used to see that the exception must be thrown is
     a) Read length bytes (InputStream.read(byte[] b, int off, int len))
     b) Read one more byte (read()) if this returns -1 means that the stream has
          no more data.

     If the above two steps is the algorithm for the logic the following
     snippet from the API doc of InputStream.read(byte[] b, int off, int len) might be
     relevant "An attempt is made to read as many as len bytes, but a smaller 
     number may be read, possibly zero. The number of bytes actually read is returned 
     as an integer."

3)  Also in derby2017_try1.diff bytesToRead is no longer used. bytesToRead is
     set to the minimum of DssConstants.MAX_DSS_LEN - 6 - 4 - 1 - extendedLengthByteCount.
     I think this is the maximum chunk size that can be sent. Has derby2017_try1.diff
     been tried with a stream of size greater than 32767?

Sorry if the above seem like random thoughts.

> Client driver can insert and commit partial data when a LOB stream throws IOException
or does not match the specified length
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-2017
>                 URL: https://issues.apache.org/jira/browse/DERBY-2017
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC, Network Client
>    Affects Versions: 10.2.1.6
>            Reporter: Knut Anders Hatlen
>            Assignee: Mayuresh Nirhali
>         Attachments: derby2017_try1.diff, Derby_2017_v1.diff, Derby_2017_v1.stat, StreamErrRepro.java
>
>
> When a LOB stream throws an exception or does not match the specified length, the client
driver does not raise an exception until it has finished executing the statement. Therefore,
the statement will be executed (and possibly committed) on the server even though the client
reports that the statement failed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message