[ 
https://issues.apache.org/jira/browse/DERBY-2646?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Kristian Waagan updated DERBY-2646:
-----------------------------------

    Attachment: derby-2646-02a-clob-reorg.diff
                derby-2646-02a-clob-reorg.diff

'derby-2646-02a-clob-reorg.diff' is a stab at reorganizing the upper level Clob 
code in the embedded driver.
I have run suites.All without failures.

Please note that the patch, although operational, is preliminary. I'm sorry it 
became so big, but I think it will be hard to split it up into smaller parts. 
I'm also very short on time, but I still feel this is worth getting done for 
10.3.
For now I'm primarily interested in design feedback, but other kinds of 
feedback (bugs, suggestions etc) are welcome too.

Although I plan to address more cleanup and bugs in later patches, a few fixes 
were incorporated into the 2a patch. For instance, ClobTest has 3 
failures/errors when run against trunk, but none when run with the patch.

Comments on the patch:
 a) EmbedClob now works against the new interface InternalClob
 
 b) There are two different kinds of internal Clob representations; 
StoreStreamClob (which is read-only) and ClobStreamControl (which I might 
rename, name suggestions? TemporaryClob?). If you fetch an existing Clob from 
the database, you start out with a StoreStreamClob. If you modify it, the Clob 
content is copied into ClobStreamControl. The switch is done in EmbedClob.

 c) I need to look into exception handling. For various reasons it seems many 
methods must throw SQLExceptions. StoreStreamControl tends to get 
StandardException from store, ClobStreamControl tends to get 
StandardException/SQLException from LOBStreamControl. And of course IOException 
is well represented.

 d) I need to look into/verify synchronization (on the connection child). Can 
anyone please enlighten me on the importance of calling 
setupContextStack/restoreContextStack?

 e) All character positions in InternalClob are 1-based. Byte positions are 
0-based.

 f) Positioning streams at character positions are done by reading the byte 
stream from position 0 and counting characters. This implies UTF-8 decoding. 
Changing this will not happen in this patch/issue. Different improvements might 
be suitable for the store streams and the temporary Clobs (i.e. caching 
positions or changing to UTF-16).


My apologies for bringing a rather big change to the community this close to 
the freeze date. However, unless I get serious pushback, I will drive this 
forward to completion for 10.3.

> Cleanup of Clob control/support structures
> ------------------------------------------
>
>                 Key: DERBY-2646
>                 URL: https://issues.apache.org/jira/browse/DERBY-2646
>             Project: Derby
>          Issue Type: Sub-task
>          Components: JDBC
>    Affects Versions: 10.3.0.0
>            Reporter: Kristian Waagan
>         Assigned To: Kristian Waagan
>         Attachments: derby-2646-01a_trailing_space.diff, 
> derby-2646-01a_trailing_space.stat, derby-2646-02a-clob-reorg.diff, 
> derby-2646-02a-clob-reorg.diff
>
>


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

Reply via email to