[
https://issues.apache.org/jira/browse/DERBY-3907?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Kristian Waagan updated DERBY-3907:
-----------------------------------
Attachment: derby-3907-7a-write_new_header_format-PREVIEW.diff
Patch 'derby-3907-7a-write_new_header_format-PREVIEW.diff' enables the new
header format.
I ran into some problems with obtaining the version of the database being
written into, so I had to change where the header is generated. To be able to
use the context service to gain access to the data dictionary, there must be
context. The context is not pushed in for instance
EmbedPreparedStatement.setCharacterStream. To solve this, I added the
requirement that StringDataValue.generateStreamHeader has to be invoked when a
context is set up.
The new approach is to generate the header when the store is asking for the
data (during execute), which happens in ReaderToUTF8Stream.fillBuffer. The
downside of the approach, is that ReaderToUTF8Stream now takes StringDataValue
as an argument in the constructor. This makes a lot more code available in the
reader, and it also makes the reader harder to test.
I also considered adding a method to tell the DVD the version of the database,
but I think it will be hard to make Derby invoke this method in all valid
use-cases, and it breaks with the pattern used in the existing classes.
A second option is to add a stream header generation object, which can be
passed in to ReaderToUTF8Stream. I think this can be done by
modifying/replacing the StreamHeaderHolder, and I think it can be done easily.
The difference is that the header generation will be postponed.
I'll continue the work on Monday, and I will most likely post another patch
implementing the approach with a separate class generating the header.
Please comment if you think I'm heading down the wrong road.
> Save useful length information for Clobs in store
> -------------------------------------------------
>
> Key: DERBY-3907
> URL: https://issues.apache.org/jira/browse/DERBY-3907
> Project: Derby
> Issue Type: Improvement
> Components: JDBC, Store
> Affects Versions: 10.5.0.0
> Reporter: Kristian Waagan
> Assignee: Kristian Waagan
> Fix For: 10.5.0.0
>
> Attachments: derby-3907-1a-alternative_approach.diff,
> derby-3907-2b-header_write_preparation.diff,
> derby-3907-2b-header_write_preparation.diff,
> derby-3907-2b-header_write_preparation.stat,
> derby-3907-2c-header_write_preparation-PREVIEW.diff,
> derby-3907-2c-header_write_preparation-PREVIEW.stat,
> derby-3907-2c-header_write_preparation.diff,
> derby-3907-2c-header_write_preparation.diff,
> derby-3907-2c-header_write_preparation.stat,
> derby-3907-3a-readertoutf8stream_cleanup.diff,
> derby-3907-3a-readertoutf8stream_cleanup.diff,
> derby-3907-3a-readertoutf8stream_cleanup.stat,
> derby-3907-3b-readertoutf8stream_cleanup.diff,
> derby-3907-4a-add_getStreamWithDescriptor.diff,
> derby-3907-4a-add_getStreamWithDescriptor.stat,
> derby-3907-5a-use_getStreamWithDescriptor.diff,
> derby-3907-5a-use_getStreamWithDescriptor.stat,
> derby-3907-6a-SQLClob_stream_descriptor_sync.diff,
> derby-3907-7a-write_new_header_format-PREVIEW.diff
>
>
> The store should save useful length information for Clobs. This allows the
> length to be found without decoding the whole data stream.
> The following thread raised the issue on what information to store, and also
> contains some background information:
> http://www.nabble.com/Storing-length-information-for-CLOB-on-disk-tp19197535p19197535.html
> The information to store, and the exact format of it, is still to be
> discussed/determined.
> Currently two bytes are set aside for length information, which is inadequate.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.