Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 78097 invoked from network); 19 May 2007 08:36:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 May 2007 08:36:37 -0000 Received: (qmail 10847 invoked by uid 500); 19 May 2007 08:36:43 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 10821 invoked by uid 500); 19 May 2007 08:36:43 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 10809 invoked by uid 99); 19 May 2007 08:36:43 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 19 May 2007 01:36:43 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 19 May 2007 01:36:36 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 2F0F5714063 for ; Sat, 19 May 2007 01:36:16 -0700 (PDT) Message-ID: <21816860.1179563776166.JavaMail.jira@brutus> Date: Sat, 19 May 2007 01:36:16 -0700 (PDT) From: =?utf-8?Q?=C3=98ystein_Gr=C3=B8vlen_=28JIRA=29?= To: derby-dev@db.apache.org Subject: [jira] Updated: (DERBY-2496) Implement Blob support for Locators In-Reply-To: <6069414.1175082933159.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DERBY-2496?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:all-tabpanel ] =C3=98ystein Gr=C3=B8vlen updated DERBY-2496: ----------------------------------- Attachment: blobtestfix.diff The patch, blobtestfix.diff, changes a few Junit tests to not expect Blob o= bjects to valid after transaction has committed. This is done in two ways:= =20 1) Delay the closing of the result set until the Blob has been accessed= . 2) Switch off autocommit. The first change is used where possible, but where Blob objects obtained fr= om different statements are to be compared, autocommit can not be used. It= is safe to apply these test changes before the use of locators are enabled= since it a more restrictive lifespan for Blob objects are assumed. The patch also contains two protocol fixes uncovered while running the test= s with locators enabled: - The type of locator requested from the server depends on the nullabili= ty of the column - If the column value of zero is received, this is not a locator, but me= ans that length of LOB column is 0. Also added bufferering to InputStreams in order to significantly reduce the= run time of some test cases. derbyall has been run without errors. Junit All suite has been run with th= e regular procedureInTrigger and encryption test errors. File-by-file explanation of changes: M java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/BlobT= est.java - Adjusted tests to not expect Blob objects to be valid after transaction commit.=20 M java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/Prepa= redStatementTest.java - Adjusted tests to not expect Blob objects to be valid after transaction commit.=20 - Rewrote testSetBlobLengthless to take advantage of the existence of Connection.createBlob=20 M java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/Resul= tSetTest.java - Adjusted tests to not expect Blob objects to be valid after transaction commit.=20 M java/client/org/apache/derby/client/net/NetCursor.java - If the column value is zero, a locator was not sent. Instead, this means that the length of the LOB is 0. Changed locator() to return INVALID_LOCATOR when the column value is zero. =20 M java/client/org/apache/derby/client/net/NetStatementRequest.java - If column is not nullable, a non-nullable locator must be requested. Otherwise, the server will send an extra byte for nullability which is not expected by the client. M java/client/org/apache/derby/client/am/BlobLocatorOutputStream.java - Added an assert that checks that the underlying Blob object is locator based. M java/client/org/apache/derby/client/am/Blob.java - Add buffering for InputStreams by wrapping BlobLocatorInputStream in a BufferedInputStream. (Doing the same for OutputStreams is not that straight-forward since that requires that the stream is flushed before the statement is executed.) M java/client/org/apache/derby/client/am/BlobLocatorInputStream.java - Removed a TAB. Client code is supposed to be a TAB-free zone! > Implement Blob support for Locators > ----------------------------------- > > Key: DERBY-2496 > URL: https://issues.apache.org/jira/browse/DERBY-2496 > Project: Derby > Issue Type: Sub-task > Components: Network Server > Reporter: =C3=98ystein Gr=C3=B8vlen > Assigned To: =C3=98ystein Gr=C3=B8vlen > Attachments: blob-followup.diff, blob-followup_v2.diff, blob-foll= owup_v2.diff, blob.diff, blob_v2.diff, blobtestfix.diff > > > DERBY-2347 adds the possibility to send locators between client and serve= r instead of LOB values. This has not been activated yet, since the client= implementation does not currently support locators. This report is for su= pporting the locators for Blob objects. Another JIRA issue will be made fo= r 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 Locato= r implementation cannot be exposed until everything has been done. At leas= t, doing just step 1, gives testing errors because tests use Blobs fetched = from DB as parameters to prepared statements. I would guess tests for upd= atable result sets, needs the combination of 1. and 3. --=20 This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.