Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 12578 invoked from network); 6 Feb 2007 05:30:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Feb 2007 05:30:27 -0000 Received: (qmail 63073 invoked by uid 500); 6 Feb 2007 05:30:33 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 63043 invoked by uid 500); 6 Feb 2007 05:30:33 -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 63033 invoked by uid 99); 6 Feb 2007 05:30:33 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Feb 2007 21:30:33 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= 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; Mon, 05 Feb 2007 21:30:25 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id B8A157142D4 for ; Mon, 5 Feb 2007 21:30:05 -0800 (PST) Message-ID: <19616913.1170739805754.JavaMail.jira@brutus> Date: Mon, 5 Feb 2007 21:30:05 -0800 (PST) From: "V.Narayanan (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Commented: (DERBY-2247) provide set methods for blob in embeded driver In-Reply-To: <16331497.1169021907835.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DERBY-2247?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12470452 ] V.Narayanan commented on DERBY-2247: ------------------------------------ Anurag's code looks very good. My comments are mostly nits. java/engine/org/apache/derby/impl/jdbc/LOBStreamControl.java ------------------------------------------------------------ Pls mention reason for choosing buffer size as 4096, if there was a particular reason for choosing this value. Otherwise pls mention that it was a random value. init - line nos 72 and 74 ---- Can the Monitor and the DataFactory be resused instead of doing a findService, findServiceModule each time? line no 77 ---------- String str = df.getStorageFactory().getTempDir().getPath(); (str is not being used anywhere) line nos 171,196,229 -------------------- write methods I notice that you have repeated the code snippet if (isBytes) { if (pos + 1 < MAX_BUF_SIZE) { byte [] bytes = {(byte) b}; updateData(bytes, 0, 1, pos); return pos + 1; } else { init(dataBytes, pos); } } if (tmpFile.getFilePointer() != pos) tmpFile.seek(pos); tmpFile.write(b); return tmpFile.getFilePointer(); in all the three set methods. Is it possible that you can combine the code into one method that can be called from all the three set methods? java/engine/org/apache/derby/impl/jdbc/EmbedBlob.java ------------------------------------------------------- can materialized can be initialized to false during declaration? can control be initialized to null during declaration? set methods ----------- you check the following in the set methods if (pos - 1 > length()) throw Util.generateCsSQLException( SQLState.BLOB_POSITION_TOO_LARGE, new Long(pos)); if (pos < 1) throw Util.generateCsSQLException( SQLState.BLOB_BAD_POSITION, new Long(pos)); But would'nt isValidPostion(pos) in control.write take care of this and throw appropriate exception? truncate ------- can you move length checks inside truncate methods into control class similar to pos checks? Some general comments --------------------- There are a few missing javadocs and some javadocs missing the @throws tags. > provide set methods for blob in embeded driver > ---------------------------------------------- > > Key: DERBY-2247 > URL: https://issues.apache.org/jira/browse/DERBY-2247 > Project: Derby > Issue Type: Sub-task > Components: JDBC > Environment: all > Reporter: Anurag Shekhar > Assigned To: Anurag Shekhar > Priority: Minor > Attachments: derby-2247.diff, derby-2247v2-using_StoreFactory.diff > > -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.