Hi All,

I was looking into Derby-2017 (https://issues.apache.org/jira/browse/DERBY-2017) the following were my findings : - when error occurs, then a dummyDSS is built and the partial data (which is *'this' *in the repro ) is sent across to NetworkServer. Now when the next select statement is executed, it commits the transaction and the partial data gets committed and select returns the incorrect committed data.

- I modified the repro to rollback the transaction when error occurs, then it behaves correctly.

code snippet....................

StringReader reader = new StringReader("this string is way too long");
       ps.setCharacterStream(1, reader, 5);

       try {
           ps.executeUpdate();
       } catch (SQLException e) {
           *c.rollback(); //see here*
           System.out.println(e);
       }
---------------------------------------------------

- DRDA Header specifications provides a flag which can notify that error had occurred & do not continue.

/**
    * Read DSS header
    * DSS Header format is
    *     2 bytes    - length
    *    1 byte    - 'D0'    - indicates DDM data
    *     1 byte    - DSS format
    *        |---|---------|----------|
    *        | 0    |  flags  |  type    |
    *        |---|---------|----------|
    *        | 0 | 1  2  3 | 4 5 6 7  |
    *        |---|---------|----------|
    *        bit 0 - '0'
    *        bit 1 - '0' - unchained, '1' - chained
* *bit 2 - '0' - do not continue on error, '1' - continue on error //See Here* * bit 3 - '0' - next DSS has different correlator, '1' - next DSS has
    *                        same correlator
..........
*/

- What I observed is, when error occurs (i.e. accumulateReadError) and writeCommitSubstitute is called where a dummy DSS is built (buildDummyEXCSAT()). - buildDss() method write the header information and here we should set the CONTINUE_ON_ERROR flag to '0' thus the data shold not be send to NetworkServer. Is my understanding correct? I am new to this part of derby and not familiar with the DRDA implementation.
Comments/Suggestions please.

I tried to follow Army's work on DERBY-35, but that is much target for chaining and I am not aware about Tomohito 's work in Layer B streaming. Can anyone help me out in this.

Thanks,
Saurabh

Reply via email to