Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 75575 invoked from network); 11 Jun 2005 00:56:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 11 Jun 2005 00:56:52 -0000 Received: (qmail 59166 invoked by uid 500); 11 Jun 2005 00:56:51 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 59136 invoked by uid 500); 11 Jun 2005 00:56:51 -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: "Derby Development" Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 59121 invoked by uid 99); 11 Jun 2005 00:56:50 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from ajax-1.apache.org (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.28) with ESMTP; Fri, 10 Jun 2005 17:56:49 -0700 Received: from ajax.apache.org (ajax.apache.org [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id DDE58EB for ; Sat, 11 Jun 2005 02:56:46 +0200 (CEST) Message-ID: <622010228.1118451406907.JavaMail.jira@ajax.apache.org> Date: Sat, 11 Jun 2005 02:56:46 +0200 (CEST) From: "Sunitha Kambhampati (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Updated: (DERBY-302) Takes over 3 minutes to insert a 500kb String into CLOB In-Reply-To: <1622274815.1116526853116.JavaMail.jira@ajax.apache.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/DERBY-302?page=all ] Sunitha Kambhampati updated DERBY-302: -------------------------------------- Attachment: fixclobperf_0610.txt This patch addresses Mike's comments (#1 and #2)in http://mail-archives.apache.org/mod_mbox/db-derby-dev/200506.mbox/%3c42A9CE92.7070808@sbcglobal.net%3e 1) Added final to the methods except for SQLChar for performance reasons. 2) Added constants to improve readability for all the humbers. - Ran derbyall on jdk142 OK. > Takes over 3 minutes to insert a 500kb String into CLOB > ------------------------------------------------------- > > Key: DERBY-302 > URL: http://issues.apache.org/jira/browse/DERBY-302 > Project: Derby > Type: Bug > Components: SQL > Environment: Windows XP Professional, Dell Pentium IV > Reporter: Glenn Orbon > Assignee: Sunitha Kambhampati > Attachments: fixclobperf_0609.txt, fixclobperf_0610.txt > > I downloaded a Cloudescape Version 10 from here http://www-106.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html. Not sure exactly which version of 10 this is. > Would like to store up to a 10MB XML string in a CLOB. However, I noticed it took over 3 minutes to insert a 500kb string. I am using the PreparedStatement to get around the 37kb limitation encountered in a previous issue. It takes less than 2 seconds to insert a 500kb string into a CLOB in mySQl. > Here the snippet: > FileReader fr = new FileReader ("sample.txt"); > BufferedReader br = new BufferedReader(fr); > String record = null; > try { > while ( (record=br.readLine()) != null ) { > bufferStr.append( record ); > } > } catch (IOException e) { > // > // put your error-handling code here > // > System.out.println("Error reading file"); > } > System.out.println("Size of inputStr: "+bufferStr.length() ); > > PreparedStatement ps = mm.connection.prepareStatement("INSERT into documents VALUES (?,?)" ); > ps.setInt(1, 13 ); > StringReader reader1 = new StringReader(bufferStr.toString()); > ps.setCharacterStream(2, reader1, bufferStr.length()); > System.out.println("Uploading string...."); > ps.execute(); > System.out.println("Done uploading string..."); > mm.connection.commit(); > Thanks for your the help, > Glenn O. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira