db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Øystein Grøvlen (JIRA) <j...@apache.org>
Subject [jira] Updated: (DERBY-2496) Implement Blob support for Locators
Date Mon, 23 Apr 2007 17:24:15 GMT

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

Øystein Grøvlen updated DERBY-2496:
-----------------------------------

    Attachment: blob.diff

The attached patch, blob.diff, adds support for locators for Blob methods and ResultSet.getXXX
methods.  Note that the use of locators for Blob is still not enabled.  The other steps mentioned
in this Jira is also needed before locators can be used.

Another thing to note about this patch is that the implementation of locator based streams
are pretty basic.  No bufferering is done.  Hence, the byte[] versions of read/write should
be used if performance is a concern.  (The parameterless versions of read/write will only
send one byte per client/server round-trip.)

More detailed description of changes:

M java/client/org/apache/derby/client/net/NetStatementRequest.java
    * Do not request locators for Clob, only Blob.  Necessary to be able to add locators for
Blob independently of Clob.

M java/client/org/apache/derby/client/net/NetCursor.java
    * If locator is sent, do not assume any external data.  (If external data highest bit
of  in-place column value will be set.)
   * Create locator based Blob object if locator is sent.

M java/client/org/apache/derby/client/am/Cursor.java
    * Made get_INTEGER protected so sub-classes (Netcursor) can use it to read locator value.

M java/client/org/apache/derby/client/am/Blob.java
    * Add constructor for locator based Blob object.
    * Make all Blob operations support locators.  Operations are performed by calling stored
procedures through the framework implemented by CallableLocatorProcedures class.
    * Create locator based versions of streams for locator based Blob objects

M java/client/org/apache/derby/client/am/Lob.java
    * Added locator field to record locator of locator based Lobs and a new constant to be
used to record the data type to be Locator based.
    * If locator based and length not yet obtained, sqlLength() will call getLocatorLength()
to get the length.
    * A dummy implementation of getLocatorLength() is added, subclasses should override.
    * Add methods for checking if Lob is locator based, and for returning the locator value.

A java/client/org/apache/derby/client/am/BlobLocatorOutputStream.java
    * OutputStream for locator based Blob.
    * No buffering is done. Hence, for efficiency, byte[] version of write should be used.
 
A java/client/org/apache/derby/client/am/BlobLocatorInputStream.java
    * InputStream for locator based Blob.
    * No buffering is done. Hence, for efficiency, byte[] version of read should be used.



> Implement Blob support for Locators
> -----------------------------------
>
>                 Key: DERBY-2496
>                 URL: https://issues.apache.org/jira/browse/DERBY-2496
>             Project: Derby
>          Issue Type: Sub-task
>            Reporter: Øystein Grøvlen
>         Assigned To: Øystein Grøvlen
>         Attachments: blob.diff
>
>
> DERBY-2347 adds the possibility to send locators between client and server instead of
LOB values.  This has not been activated yet, since the client implementation does not currently
support locators.  This report is for supporting the locators for Blob objects.  Another JIRA
issue will be made for Clob.
> This work will be made in several steps:
>    1. Blob methods and ResultSet.getXXX methods
>    2. PreparedStatement and CallableStatement methods
>    3. ResultSet.updateXXX methods
>    4. Connection.createBlob()
> There is dependencies between these steps and it might be that the Locator implementation
cannot be exposed until everything has been done.  At least, doing just step 1, gives testing
errors because tests use Blobs fetched from DB as parameters to prepared statements.   I would
guess tests for updatable result sets, needs the combination of 1. and 3.

-- 
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